## List available chat completion models

`client.Chat.Completions.Models(ctx, query) (*ChatCompletionModelsResponse, error)`

**get** `/v5/chat/completions/models`

Lists the models available for use with /v5/chat/completions.

Results are served directly from the stored inference-models catalog filtered to the chat-completion
model type, not from a live provider probe, so availability reflects the catalog's recorded status.
Pass the optional `model_vendor` query parameter to restrict results to a single vendor. Results are
paginated, and each entry reports the model name, vendor, type, and availability. If the underlying
catalog query fails the endpoint returns an empty list rather than raising an error.

### Parameters

- `query ChatCompletionModelsParams`

  - `EndingBefore param.Field[string]`

  - `Limit param.Field[int64]`

  - `ModelVendor param.Field[InferenceModelVendor]`

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

### Returns

- `type ChatCompletionModelsResponse struct{…}`

  - `Items []ModelDefinition`

    - `ModelName string`

      model name, for example `gpt-4o`

    - `ModelType InferenceModelType`

      model type, for example `chat_completion`

      - `const InferenceModelTypeGeneric InferenceModelType = "generic"`

      - `const InferenceModelTypeCompletion InferenceModelType = "completion"`

      - `const InferenceModelTypeChatCompletion InferenceModelType = "chat_completion"`

    - `ModelVendor InferenceModelVendor`

      model vendor, for example `openai`

      - `const InferenceModelVendorOpenAI InferenceModelVendor = "openai"`

      - `const InferenceModelVendorCohere InferenceModelVendor = "cohere"`

      - `const InferenceModelVendorVertexAI InferenceModelVendor = "vertex_ai"`

      - `const InferenceModelVendorAnthropic InferenceModelVendor = "anthropic"`

      - `const InferenceModelVendorAzure InferenceModelVendor = "azure"`

      - `const InferenceModelVendorGemini InferenceModelVendor = "gemini"`

      - `const InferenceModelVendorLaunch InferenceModelVendor = "launch"`

      - `const InferenceModelVendorLlmengine InferenceModelVendor = "llmengine"`

      - `const InferenceModelVendorModelZoo InferenceModelVendor = "model_zoo"`

      - `const InferenceModelVendorBedrock InferenceModelVendor = "bedrock"`

      - `const InferenceModelVendorXai InferenceModelVendor = "xai"`

      - `const InferenceModelVendorFireworksAI InferenceModelVendor = "fireworks_ai"`

    - `ModelAvailability InferenceModelAvailability`

      model availability indicating availability status, for example `available`

      - `const InferenceModelAvailabilityUnknown InferenceModelAvailability = "unknown"`

      - `const InferenceModelAvailabilityAvailable InferenceModelAvailability = "available"`

      - `const InferenceModelAvailabilityUnavailable InferenceModelAvailability = "unavailable"`

  - `Object ChatCompletionModelsResponseObject`

    - `const ChatCompletionModelsResponseObjectList ChatCompletionModelsResponseObject = "list"`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  response, err := client.Chat.Completions.Models(context.TODO(), sgpdev.ChatCompletionModelsParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Items)
}
```

#### Response

```json
{
  "items": [
    {
      "model_name": "model_name",
      "model_type": "generic",
      "model_vendor": "openai",
      "model_availability": "unknown"
    }
  ],
  "object": "list"
}
```
