Ir al contenido

API de relay: models

Esta página se genera a partir de docs-site/openapi/relay.yaml. Su contenido está en inglés; no la edites a mano.

Model listing in the OpenAI, Anthropic and Gemini shapes.

List models

operationId relayListModels · auth: bearerAuth or apiKeyHeader or googApiKeyHeader or googApiKeyQuery

Lists the models your key may use and that currently have a price and at least one provider. A request that carries anthropic-version and no Authorization header gets the Anthropic list shape and Anthropic errors.

Status Meaning Body
200 The model list. application/json ModelList
default Error in the OpenAI envelope (error.message, error.type, error.param, error.code). application/json OpenAIError

Response 200 application/json — ModelList

  • object (string)
  • data (array of Model)
    • id (string) — Model slug. Use it as model.
    • object (string)
    • created (integer)
    • owned_by (string)
    • name (string)
    • context_length (integer)
    • max_output_tokens (integer)
    • deprecated (boolean)

Get one model

operationId relayGetModel · auth: bearerAuth or apiKeyHeader or googApiKeyHeader or googApiKeyQuery

Parameter In Type Required Description
model path string yes
Status Meaning Body
200 The model. application/json Model
404 Error in the OpenAI envelope (error.message, error.type, error.param, error.code). application/json OpenAIError
default Error in the OpenAI envelope (error.message, error.type, error.param, error.code). application/json OpenAIError

Response 200 application/json — Model

  • id (string) — Model slug. Use it as model.
  • object (string)
  • created (integer)
  • owned_by (string)
  • name (string)
  • context_length (integer)
  • max_output_tokens (integer)
  • deprecated (boolean)

List models (Gemini shape)

operationId relayListGeminiModels · auth: googApiKeyHeader or googApiKeyQuery or bearerAuth

Status Meaning Body
200 Chat and embedding models with supportedGenerationMethods. application/json OpenAIObject
default Error in the Google envelope (error.code, error.message, error.status). application/json GeminiError

Response 200 application/json — OpenAIObject

The provider-shaped response object of the dialect, with cost added inside its usage object.