> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiforgeo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Models, countries and languages, with prices



## OpenAPI

````yaml /api-reference/openapi.json get /v1/models
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.


    ## Authentication


    Send an API key from the dashboard with every request: `Authorization:
    Bearer afg_live_...`.


    ## Money


    Amounts 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.


    ## Test keys


    A 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.


    ## Results


    A 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.


    ## Errors


    Every error has one shape: `{ "error": { "code", "message", "details",
    "requestId" } }`. Act on `code`; quote `requestId` to support.


    ## Webhooks


    Pass `webhookUrl` on a task, or add endpoints in the dashboard. API for GEO
    then POSTs events:


    ```json

    { "type": "task.completed", "timestamp": "2026-10-24T12:00:05.000Z", "data":
    { "id": "task_...", "status": "completed", "result": {} } }

    ```


    | Event | `data` |

    | --- | --- |

    | `task.completed` | The task, with its result |

    | `task.failed` | The task, with `error`, and `refunded: true` for a live
    key |

    | `balance.low`, `balance.depleted` | `currency`, `balanceMicros`,
    `lowBalanceThresholdMicros` |


    A 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.


    ### Verify the signature


    Deliveries follow [Standard Webhooks](https://www.standardwebhooks.com).
    Each one has three headers:


    - `webhook-id`: the event id, the same on every retry. Use it to drop a
    duplicate.

    - `webhook-timestamp`: Unix seconds.

    - `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.


    Check the raw body, before you parse it:


    ```js

    import { createHmac, timingSafeEqual } from 'node:crypto';


    function verifyWebhook(secret, headers, rawBody) {
      const id = headers['webhook-id'];
      const timestamp = headers['webhook-timestamp'];
      if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // older than 5 minutes: a replay
      const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
      const expected = Buffer.from(`v1,${createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest('base64')}`);
      return headers['webhook-signature'].split(' ').some((candidate) => {
        const given = Buffer.from(candidate);
        return given.length === expected.length && timingSafeEqual(given, expected);
      });
    }

    ```


    A 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.
servers:
  - url: https://api.apiforgeo.com
security: []
paths:
  /v1/models:
    get:
      tags:
        - Catalog
      summary: Models, countries and languages, with prices
      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'
      security:
        - apiKey: []
components:
  schemas:
    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
    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
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'An API key from the dashboard: `afg_live_…` or `afg_test_…`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.