Skip to content

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.

ParametersExpand Collapse
query ChatCompletionModelsParams
EndingBefore param.Field[string]Optional
Limit param.Field[int64]Optional
maximum10000
minimum1
ModelVendor param.Field[InferenceModelVendor]Optional
SortBy param.Field[string]Optional
SortOrder param.Field[SortOrder]Optional
StartingAfter param.Field[string]Optional
ReturnsExpand Collapse
type ChatCompletionModelsResponse struct{…}
ModelName string

model name, for example gpt-4o

model type, for example chat_completion

One of the following:
const InferenceModelTypeGeneric InferenceModelType = "generic"
const InferenceModelTypeCompletion InferenceModelType = "completion"
const InferenceModelTypeChatCompletion InferenceModelType = "chat_completion"

model vendor, for example openai

One of the following:
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 InferenceModelAvailabilityOptional

model availability indicating availability status, for example available

One of the following:
const InferenceModelAvailabilityUnknown InferenceModelAvailability = "unknown"
const InferenceModelAvailabilityAvailable InferenceModelAvailability = "available"
const InferenceModelAvailabilityUnavailable InferenceModelAvailability = "unavailable"
Object ChatCompletionModelsResponseObjectOptional

List available chat completion models

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)
}
{
  "items": [
    {
      "model_name": "model_name",
      "model_type": "generic",
      "model_vendor": "openai",
      "model_availability": "unknown"
    }
  ],
  "object": "list"
}
Returns Examples
{
  "items": [
    {
      "model_name": "model_name",
      "model_type": "generic",
      "model_vendor": "openai",
      "model_availability": "unknown"
    }
  ],
  "object": "list"
}