{
  "openapi": "3.1.0",
  "info": {
    "title": "API for GEO",
    "version": "1.0.0",
    "description": "Send a prompt to an AI model in a country and a language. Get back, asynchronously, the model's answer with its entities and their sentiment, its sources, the web searches it ran (fan-outs), its products and its ads.\n\n## Authentication\n\nSend an API key from the dashboard with every request: `Authorization: Bearer afg_live_...`.\n\n## Money\n\nAmounts are integer micro-dollars: `costMicros: 13000` is $0.013. A task is charged when it is created, and refunded if it fails. Send an `Idempotency-Key` header to retry a creation safely: the same key returns the first task, charged once.\n\n## Test keys\n\nA test key (`afg_test_...`) runs in a sandbox: it is never charged, and the result is a sample of the live shape. A prompt with `[fail]` in it fails; `[slow]` takes about 2 minutes; any other prompt completes in about 15 seconds.\n\n## Results\n\nA completed task's result is readable for 7 days after completion (`resultExpiresAt`). After that, `result` is null. The task itself, with its cost and its metadata, stays. Save what you need within the 7 days.\n\n## Errors\n\nEvery error has one shape: `{ \"error\": { \"code\", \"message\", \"details\", \"requestId\" } }`. Act on `code`; quote `requestId` to support.\n\n## Webhooks\n\nPass `webhookUrl` on a task, or add endpoints in the dashboard. API for GEO then POSTs events:\n\n```json\n{ \"type\": \"task.completed\", \"timestamp\": \"2026-10-24T12:00:05.000Z\", \"data\": { \"id\": \"task_...\", \"status\": \"completed\", \"result\": {} } }\n```\n\n| Event | `data` |\n| --- | --- |\n| `task.completed` | The task, with its result |\n| `task.failed` | The task, with `error`, and `refunded: true` for a live key |\n| `balance.low`, `balance.depleted` | `currency`, `balanceMicros`, `lowBalanceThresholdMicros` |\n\nA task's `webhookUrl` gets that task's two events. Answer with a 2xx within 10 seconds. Anything else is sent again after 5 seconds, 5 minutes, 30 minutes, then 2, 5, 10 and 10 hours. An endpoint that fails all through those 27 hours is turned off, and the organization's owners and admins get an email.\n\n### Verify the signature\n\nDeliveries follow [Standard Webhooks](https://www.standardwebhooks.com). Each one has three headers:\n\n- `webhook-id`: the event id, the same on every retry. Use it to drop a duplicate.\n- `webhook-timestamp`: Unix seconds.\n- `webhook-signature`: `v1,` and the base64 HMAC-SHA256 of `<id>.<timestamp>.<body>`. The key is your secret without `whsec_`, base64-decoded. During a secret rotation, two signatures come, separated by a space: accept either.\n\nCheck the raw body, before you parse it:\n\n```js\nimport { createHmac, timingSafeEqual } from 'node:crypto';\n\nfunction verifyWebhook(secret, headers, rawBody) {\n  const id = headers['webhook-id'];\n  const timestamp = headers['webhook-timestamp'];\n  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // older than 5 minutes: a replay\n  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');\n  const expected = Buffer.from(`v1,${createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest('base64')}`);\n  return headers['webhook-signature'].split(' ').some((candidate) => {\n    const given = Buffer.from(candidate);\n    return given.length === expected.length && timingSafeEqual(given, expected);\n  });\n}\n```\n\nA Standard Webhooks library does the same in one call, in many languages. An endpoint's secret is shown when you add it or rotate it. The deliveries to a task's `webhookUrl` use the organization's task webhook secret, in the dashboard.\n"
  },
  "servers": [
    {
      "url": "https://api.apiforgeo.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from the dashboard: `afg_live_…` or `afg_test_…`."
      }
    },
    "schemas": {
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "prompt": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "enrichments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "webhookUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "costMicros": {
            "type": "integer",
            "description": "What the task was charged, in micro-dollars: 13000 is $0.013. 0 for a test key."
          },
          "refunded": {
            "type": "boolean"
          },
          "apiKeyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "failedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "resultExpiresAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the result stops being readable: 7 days after completion. Null until the task completes."
          },
          "result": {
            "$ref": "#/components/schemas/TaskResult"
          }
        },
        "required": [
          "id",
          "status",
          "mode",
          "prompt",
          "model",
          "country",
          "language",
          "enrichments",
          "metadata",
          "webhookUrl",
          "costMicros",
          "refunded",
          "apiKeyId",
          "createdAt",
          "startedAt",
          "completedAt",
          "failedAt",
          "error",
          "resultExpiresAt",
          "result"
        ]
      },
      "TaskResult": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "answer": {
            "type": "string",
            "description": "The model's answer, as it gave it (markdown)."
          },
          "entities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "example": "brand"
                },
                "position": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "mentions": {
                  "type": "integer"
                },
                "sentiment": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "From -1 (negative) to +1 (positive). Null when not scored.",
                  "example": 0.8
                },
                "stance": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "chosen",
                    "described",
                    "named",
                    "dismissed",
                    "criticized",
                    null
                  ],
                  "description": "How the answer treats the entity. Null when not judged.",
                  "example": "chosen"
                }
              },
              "required": [
                "name",
                "type",
                "position",
                "mentions",
                "sentiment",
                "stance"
              ]
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "domain": {
                  "type": "string"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              },
              "required": [
                "url",
                "domain",
                "title",
                "position"
              ]
            }
          },
          "fanOuts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "phrase": {
                  "type": "string",
                  "example": "best running shoes for flat feet 2026"
                }
              },
              "required": [
                "phrase"
              ]
            },
            "description": "The web searches the model ran while it answered, in its order."
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "brand": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "price": {
                  "$ref": "#/components/schemas/Money"
                },
                "rating": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "reviewCount": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "imageUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                },
                "merchants": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "price": {
                        "$ref": "#/components/schemas/Money"
                      }
                    },
                    "required": [
                      "name",
                      "url",
                      "price"
                    ]
                  }
                }
              },
              "required": [
                "name",
                "brand",
                "price",
                "rating",
                "reviewCount",
                "imageUrl",
                "position",
                "merchants"
              ]
            }
          },
          "ads": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "position": {
                  "type": "integer"
                },
                "format": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The ad format, as the engine names it."
                },
                "advertiser": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Who paid for the ad."
                },
                "brand": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "body": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "imageUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "price": {
                  "$ref": "#/components/schemas/Money"
                },
                "strikethroughPrice": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Money"
                    },
                    {
                      "description": "The crossed-out price beside it, when the ad shows one."
                    }
                  ]
                },
                "rating": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "position",
                "format",
                "advertiser",
                "brand",
                "title",
                "body",
                "imageUrl",
                "url",
                "price",
                "strikethroughPrice",
                "rating"
              ]
            },
            "description": "The sponsored cards shown with the answer."
          }
        },
        "required": [
          "answer",
          "entities",
          "sources",
          "fanOuts",
          "products",
          "ads"
        ],
        "description": "Once completed, on GET /v1/tasks/{taskId} only, for 7 days (resultExpiresAt). Null after that; the task stays."
      },
      "Money": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "amountMicros": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "amountMicros",
          "currency"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "example": "insufficient_balance"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {}
              },
              "requestId": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "details",
              "requestId"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "CreateTask": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "example": "best running shoes for flat feet"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "example": "chatgpt"
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "example": "US"
          },
          "language": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10,
            "example": "en"
          },
          "enrichments": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "description": "Accepted for later. V1 computes every enrichment: entities, sentiment, sources, fan-outs, shopping, ads."
          },
          "webhookUrl": {
            "type": "string",
            "maxLength": 2048,
            "description": "https only. Gets task.completed or task.failed for this task."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            },
            "description": "Your own labels, returned as given.",
            "example": {
              "campaign": "q4"
            }
          }
        },
        "required": [
          "prompt",
          "model",
          "country",
          "language"
        ]
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "priceMicros": {
                  "type": "integer",
                  "description": "A task on this model, every enrichment included."
                },
                "countries": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  },
                  "description": "Where it runs. Null: every country below."
                }
              },
              "required": [
                "id",
                "name",
                "priceMicros",
                "countries"
              ]
            }
          },
          "enrichments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "priceMicros": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "name",
                "priceMicros"
              ]
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name"
              ]
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name"
              ]
            }
          }
        },
        "required": [
          "models",
          "enrichments",
          "countries",
          "languages"
        ]
      },
      "PublicBalance": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "balanceMicros": {
            "type": "integer"
          },
          "alertState": {
            "type": "string",
            "enum": [
              "ok",
              "low",
              "depleted"
            ]
          }
        },
        "required": [
          "currency",
          "balanceMicros",
          "alertState"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "tasks": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "spendMicros": {
            "type": "integer"
          },
          "averageCostMicros": {
            "type": "integer",
            "description": "Spend over the charged tasks: failed ones are refunded."
          },
          "failureRate": {
            "type": "number",
            "description": "Percent of the tasks that failed, 0 to 100."
          },
          "byDay": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "tasks": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "spendMicros": {
                  "type": "integer"
                },
                "models": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "description": "Spend by model that day."
                }
              },
              "required": [
                "date",
                "tasks",
                "failed",
                "spendMicros",
                "models"
              ]
            }
          },
          "byModel": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                },
                "tasks": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "spendMicros": {
                  "type": "integer"
                },
                "share": {
                  "type": "number",
                  "description": "Percent of the spend, 0 to 100."
                }
              },
              "required": [
                "model",
                "tasks",
                "failed",
                "spendMicros",
                "share"
              ]
            }
          },
          "byKey": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "apiKeyId": {
                  "type": "string"
                },
                "tasks": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "spendMicros": {
                  "type": "integer"
                },
                "share": {
                  "type": "number"
                }
              },
              "required": [
                "apiKeyId",
                "tasks",
                "failed",
                "spendMicros",
                "share"
              ]
            }
          }
        },
        "required": [
          "from",
          "to",
          "tasks",
          "failed",
          "spendMicros",
          "averageCostMicros",
          "failureRate",
          "byDay",
          "byModel",
          "byKey"
        ]
      }
    },
    "parameters": {}
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Liveness: the process answers",
        "responses": {
          "200": {
            "description": "The process is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/ready": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Readiness: Postgres and Redis answer",
        "responses": {
          "200": {
            "description": "Ready for traffic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "not_ready"
                      ]
                    },
                    "checks": {
                      "type": "object",
                      "properties": {
                        "database": {
                          "type": "boolean"
                        },
                        "redis": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "database",
                        "redis"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "checks"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A dependency does not answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "not_ready"
                      ]
                    },
                    "checks": {
                      "type": "object",
                      "properties": {
                        "database": {
                          "type": "boolean"
                        },
                        "redis": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "database",
                        "redis"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "checks"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks": {
      "post": {
        "tags": [
          "Tasks"
        ],
        "summary": "Create a task",
        "description": "Checks the model, the country and the language, the key budget and the balance, charges the task and queues it. Poll GET /v1/tasks/{taskId}, or pass webhookUrl. Send an Idempotency-Key to retry safely: the same key returns the first task, charged once.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "required": false,
            "name": "idempotency-key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTask"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replayed: the task of this Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mint": {
          "metadata": {
            "sidebarTitle": "Create a task"
          },
          "href": "/api-reference/create-a-task"
        }
      },
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "List tasks, newest first",
        "description": "Without results: read one task for its result. Pass nextCursor as cursor for the next page.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-z]+_[0-9a-f]{32}$"
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "processing",
                "completed",
                "failed",
                "running"
              ],
              "description": "`running`: queued or processing."
            },
            "required": false,
            "description": "`running`: queued or processing.",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "A task id, or words of the prompt."
            },
            "required": false,
            "description": "A task id, or words of the prompt.",
            "name": "q",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "model",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "apiKeyId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Created at or after, ISO 8601."
            },
            "required": false,
            "description": "Created at or after, ISO 8601.",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Created before, ISO 8601."
            },
            "required": false,
            "description": "Created before, ISO 8601.",
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Task"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mint": {
          "metadata": {
            "sidebarTitle": "List tasks"
          },
          "href": "/api-reference/list-tasks"
        }
      }
    },
    "/v1/tasks/{taskId}": {
      "get": {
        "tags": [
          "Tasks"
        ],
        "summary": "Get a task, with its result once completed",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "taskId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "401": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mint": {
          "metadata": {
            "sidebarTitle": "Get a task"
          },
          "href": "/api-reference/get-a-task"
        }
      }
    },
    "/v1/models": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Models, countries and languages, with prices",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          },
          "401": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mint": {
          "metadata": {
            "sidebarTitle": "List models"
          },
          "href": "/api-reference/list-models"
        }
      }
    },
    "/v1/balance": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "The organization's prepaid balance",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicBalance"
                }
              }
            }
          },
          "401": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mint": {
          "metadata": {
            "sidebarTitle": "Get the balance"
          },
          "href": "/api-reference/get-the-balance"
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Live tasks and spend, by day, model and key",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date",
              "description": "First UTC day. Default: 30 days ago."
            },
            "required": false,
            "description": "First UTC day. Default: 30 days ago.",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date",
              "description": "Last UTC day, included. Default: today."
            },
            "required": false,
            "description": "Last UTC day, included. Default: today.",
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "400": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "See error.code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mint": {
          "metadata": {
            "sidebarTitle": "Get usage"
          },
          "href": "/api-reference/get-usage"
        }
      }
    }
  },
  "webhooks": {}
}
