JavaScript
Models
Get a model
One model’s context window, price, and whether it is enabled. Skip the prefix filter and fetch it directly.
GET
JavaScript
Read one model. When you already know which one you want, this is faster and more exact than filtering the list.
The
external_id: form is the one to use, since it is also what you set on a variation’s modelConfig.modelId. The canonical model_... ID works too. A missing ID is a 404.
What the record holds
The list-models page explains the two traps in full: prices are integer cents serialized as strings (parse, then divide by 100 to render), and
maxInputTokens is what a variation’s compaction threshold is measured against, so it moves when you swap models.
state matters before you point a variation at the model. A disabled model is a 400 on spec.model_id, so read it here first if a variation create is failing on the model.
Related
List models
Every model, and the pricing and compaction details in full.
Create a variation
Where
modelConfig.modelId takes the external_id: form.Swap models on variations
Move a whole workspace off a model.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Workspace ID.
Example:
"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
Model ID
Example:
"model_01HXKD2E5NQM3T9AYWCFKJ4GED"
Response
OK
Resource metadata
Model specification
Whether the model is usable in this workspace. Output only. Use the :enable and :disable actions to transition.
Available options:
STATE_UNSPECIFIED, STATE_ENABLED, STATE_DISABLED Server-populated info (e.g. the AI provider this model routes through). Populated on reads when requested; see ListModelsRequest.include_info.