Netlify AI Gateway API

The aiGateway API from Netlify — 3 operation(s) for aigateway.

Operations 3

GET /ai-gateway/providers #
GET /sites/{site_id}/ai-gateway/token #
GET /accounts/{account_id}/ai-gateway/token #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/netlify-aigateway-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

netlify-aigateway-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 2.57.0
  title: Netlify's API documentation AI Gateway API
  description: 'Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.


    This document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify''s API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).


    Additionally, we have two API clients for your convenience:

    - [Go Client](https://github.com/netlify/open-api#go-client)

    - [JS Client](https://github.com/netlify/build/tree/main/packages/js-client)'
  termsOfService: https://www.netlify.com/legal/terms-of-use/
  x-logo:
    url: netlify-logo.png
    href: https://www.netlify.com/docs/
    altText: Netlify
servers:
- url: https://api.netlify.com/api/v1
security:
- netlifyAuth: []
tags:
- name: aiGateway
paths:
  /ai-gateway/providers:
    get:
      operationId: getAIGatewayProviders
      tags:
      - aiGateway
      security: []
      responses:
        '200':
          description: The mapping of providers and supported models
          content:
            application/json:
              schema:
                type: object
                properties:
                  providers:
                    additionalProperties:
                      type: object
                      properties:
                        token_env_var:
                          type: string
                        url_env_var:
                          type: string
                        models:
                          type: array
                          items:
                            type: string
        default:
          description: error
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  code:
                    type: integer
                    format: int64
                  message:
                    type: string
  /sites/{site_id}/ai-gateway/token:
    parameters:
    - name: site_id
      in: path
      required: true
      description: The site ID
      schema:
        type: string
    get:
      operationId: getAIGatewayToken
      tags:
      - aiGateway
      responses:
        '200':
          description: AI Gateway token for the site
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: The AI Gateway authentication token
                  url:
                    type: string
                    description: AI gateway base url
                  expires_at:
                    type: integer
                    format: int64
                    description: Unix timestamp when the token expires
        '404':
          description: AI Gateway not available for this site
        default:
          description: error
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  code:
                    type: integer
                    format: int64
                  message:
                    type: string
      description: Returns an AI Gateway token for a specific site
  /accounts/{account_id}/ai-gateway/token:
    parameters:
    - name: account_id
      in: path
      required: true
      description: The account ID
      schema:
        type: string
    get:
      operationId: getAccountAIGatewayToken
      tags:
      - aiGateway
      responses:
        '200':
          description: AI Gateway token for the account
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: The AI Gateway authentication token
                  url:
                    type: string
                    description: AI gateway base url
                  expires_at:
                    type: integer
                    format: int64
                    description: Unix timestamp when the token expires
        '404':
          description: AI Gateway not available for this account
        default:
          description: error
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  code:
                    type: integer
                    format: int64
                  message:
                    type: string
      description: Returns an AI Gateway token scoped to an account
components:
  securitySchemes:
    netlifyAuth:
      type: oauth2
      flows:
        implicit:
          scopes: {}
          authorizationUrl: https://app.netlify.com/authorize
externalDocs:
  url: https://www.netlify.com/docs/api/
  description: Online documentation
x-tagGroups:
- name: OAuth
  tags:
  - ticket
  - accessToken
- name: User accounts
  tags:
  - user
  - accountMembership
  - member
  - accountType
  - paymentMethod
  - auditLog
- name: Site
  tags:
  - site
  - environmentVariables
  - file
  - metadata
  - purge
  - snippet
- name: Domain names
  tags:
  - dnsZone
  - sniCertificate
- name: Deploys
  tags:
  - deploy
  - deployedBranch
  - deployKey
- name: Builds
  tags:
  - build
  - buildLogMsg
- name: Dev servers
  tags:
  - devServer
- name: Webhooks and notifications
  tags:
  - hook
  - hookType
  - buildHook
  - devServerHook
- name: Services
  tags:
  - service
  - serviceInstance
- name: Functions
  tags:
  - function
- name: Database
  tags:
  - database
- name: Forms
  tags:
  - form
  - submission
- name: Split tests
  tags:
  - splitTest
- name: Large media
  tags:
  - asset
  - assetPublicSignature