Models
List models and read one model's input schema and price.
The model catalogue changes often; read it from the API instead of hard-coding ids. Model ids may contain a slash (for example google/nano-banana-2): put them in the path as they are. To run a model, see Runs.
| Method | Path | Summary |
|---|---|---|
GET | /v1/models | List models. |
GET | /v1/models/{model_id} | Input schema and price of one model. |
#GET /v1/models
List models.
Authentication: Authorization: Key <key>.
type is one of image, video, audio, text; q searches id, name and capabilities. Page with offset = next_offset while has_more is true. Field values in the example are illustrative.
#Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | no | |
q | string | no | |
limit | integer (min 1) | no | |
offset | integer (min 0) | no |
#Responses
| Status | Description | Body |
|---|---|---|
200 | Models page | object |
400 | INVALID_INPUT (with field), URL_NOT_ALLOWED, MODEL_REQUIRED, MODEL_KIND_MISMATCH, MODEL_NOT_ALLOWED, DUPLICATE_ITEM or INVALID_RUN_TOKEN | Error |
401 | UNAUTHENTICATED (missing/invalid/revoked key) or KEY_SESSION_EXPIRED (sign in to aitopia.ai to reactivate the key) | Error |
429 | RATE_LIMIT, RUN_LIMITED or QUEUE_LIMIT_EXCEEDED (see retry_after_seconds and the Retry-After header) | Error |
500 | INTERNAL_ERROR (an unexpected server error) | Error |
#Example
Request
curl "https://api-live.aitopia.ai/v1/models?type=image&limit=2" \
-H "Authorization: Key $AITOPIA_KEY"Response 200
{
"models": [
{
"id": "google/nano-banana-2",
"type": "image",
"name": "Nano Banana 2",
"description": "...",
"capabilities": [
"..."
],
"price": {
"credits": 4
},
"execution_mode": "...",
"recommended": true
}
],
"has_more": true,
"next_offset": 2
}#GET /v1/models/{model_id}
Input schema and price of one model.
Authentication: Authorization: Key <key>.
input_schema is the JSON Schema of the body you send to POST /v1/models/{model_id}. The example schema is shortened.
#Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
model_id | string | yes | Model id, for example google/nano-banana-2. Send the "/" as it is or encoded as %2F (generated clients encode it); both reach the same model. |
#Responses
| Status | Description | Body |
|---|---|---|
200 | Model schema | object |
401 | UNAUTHENTICATED (missing/invalid/revoked key) or KEY_SESSION_EXPIRED (sign in to aitopia.ai to reactivate the key) | Error |
404 | MODEL_NOT_FOUND or NOT_FOUND | Error |
429 | RATE_LIMIT, RUN_LIMITED or QUEUE_LIMIT_EXCEEDED (see retry_after_seconds and the Retry-After header) | Error |
500 | INTERNAL_ERROR (an unexpected server error) | Error |
#Example
Request
curl "https://api-live.aitopia.ai/v1/models/google/nano-banana-2" \
-H "Authorization: Key $AITOPIA_KEY"Response 200
{
"id": "google/nano-banana-2",
"input_schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string"
}
},
"required": [
"prompt"
]
},
"price": {
"credits": 4
}
}