AIMLAPI Inference API

AI/ML API's own published OpenAPI, served from the API host at https://api.aimlapi.com/docs-yaml and rendered at https://api.aimlapi.com/docs. 19 operations across 16 paths covering chat completions, the Responses surface, Anthropic-shaped messages, embeddings, image generation and editing, video generation, text-to-speech, speech-to-text, music generation, OCR and batch processing. The surface is OpenAI-compatible: an OpenAI client configured with base_url https://api.aimlapi.com/v1 reaches it unchanged.

Operations 19

POST /v1/chat/completions #
POST /v1/responses #
GET /v1/responses/:response_id #
POST /v1/embeddings #
POST /v2/video/generations #
GET /v2/video/generations #
POST /v1/stt/create #
GET /v1/stt/:generation_id #
POST /v1/tts #
POST /v1/images/generations #
POST /v1/images/edits #
POST /v1/messages #
POST /v1/batches #
GET /v1/batches #
POST /v1/batches/cancel/:batch_id #
POST /v2/generate/audio #
GET /v2/generate/audio #
POST /v1/ocr #
POST /v2/generate/audio/preprocess #

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/aimlapi-inference-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

aimlapi-inference-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: AIML API
  version: 1.0.0
servers:
  - url: https://api.aimlapi.com
paths:
  /v1/chat/completions:
    post:
      operationId: _v1_chat_completions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    model:
                      type: string
                      enum:
                        - gpt-3.5-turbo
                        - openai/gpt-3.5-turbo
                        - gpt-3.5-turbo-0125
                        - openai/gpt-3.5-turbo-0125
                        - gpt-3.5-turbo-1106
                        - openai/gpt-3.5-turbo-1106
                        - gpt-3.5-turbo-0613
                        - openai/gpt-3.5-turbo-0613
                    provider:
                      type: string
                      description: >-
                        Provider routing override. Use a source key such as
                        `openai`, `openrouter`, `xai`, `google`, `alibaba`,
                        `minimax`, `moonshot`, `baidu`, or `togetherai` to run
                        that provider with no fallback; `auto` (default) uses
                        the full fallback chain. Case-insensitive.
                      example: auto
                    messages:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              role:
                                type: string
                                enum:
                                  - user
                                description: >-
                                  The role of the author of the message — in
                                  this case, the user
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of the content part.
                                        text:
                                          type: string
                                          description: The text content.
                                        cache_control:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                            ttl:
                                              type: string
                                              enum:
                                                - 5m
                                                - 1h
                                          required:
                                            - type
                                      required:
                                        - type
                                        - text
                                description: The contents of the user message.
                              name:
                                type: string
                                description: >-
                                  An optional name for the participant. Provides
                                  the model information to differentiate between
                                  participants of the same role.
                            required:
                              - role
                              - content
                          - type: object
                            properties:
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of the content part.
                                        text:
                                          type: string
                                          description: The text content.
                                        cache_control:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                            ttl:
                                              type: string
                                              enum:
                                                - 5m
                                                - 1h
                                          required:
                                            - type
                                      required:
                                        - type
                                        - text
                                description: The contents of the developer message.
                              role:
                                type: string
                                enum:
                                  - developer
                                description: >-
                                  The role of the author of the message — in
                                  this case, the developer.
                              name:
                                type: string
                                description: >-
                                  An optional name for the participant. Provides
                                  the model information to differentiate between
                                  participants of the same role.
                            required:
                              - content
                              - role
                          - type: object
                            properties:
                              role:
                                type: string
                                enum:
                                  - system
                                description: >-
                                  The role of the author of the message — in
                                  this case, the system.
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of the content part.
                                        text:
                                          type: string
                                          description: The text content.
                                        cache_control:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                            ttl:
                                              type: string
                                              enum:
                                                - 5m
                                                - 1h
                                          required:
                                            - type
                                      required:
                                        - type
                                        - text
                                description: The contents of the system message.
                              name:
                                type: string
                                description: >-
                                  An optional name for the participant. Provides
                                  the model information to differentiate between
                                  participants of the same role.
                            required:
                              - role
                              - content
                          - type: object
                            properties:
                              role:
                                type: string
                                enum:
                                  - tool
                                description: >-
                                  The role of the author of the message — in
                                  this case, the tool.
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - text
                                          description: The type of the content part.
                                        text:
                                          type: string
                                          description: The text content.
                                        cache_control:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                            ttl:
                                              type: string
                                              enum:
                                                - 5m
                                                - 1h
                                          required:
                                            - type
                                      required:
                                        - type
                                        - text
                                description: The contents of the tool message.
                              tool_call_id:
                                type: string
                                description: Tool call that this message is responding to.
                              name:
                                type: string
                                nullable: true
                                description: >-
                                  An optional name for the participant. Provides
                                  the model information to differentiate between
                                  participants of the same role.
                            required:
                              - role
                              - content
                              - tool_call_id
                          - type: object
                            properties:
                              role:
                                type: string
                                enum:
                                  - assistant
                                description: >-
                                  The role of the author of the message — in
                                  this case, the Assistant.
                              content:
                                anyOf:
                                  - type: string
                                    description: The contents of the Assistant message.
                                  - type: array
                                    items:
                                      anyOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - text
                                              description: The type of the content part.
                                            text:
                                              type: string
                                              description: The text content.
                                            cache_control:
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - ephemeral
                                                ttl:
                                                  type: string
                                                  enum:
                                                    - 5m
                                                    - 1h
                                              required:
                                                - type
                                          required:
                                            - type
                                            - text
                                        - type: object
                                          properties:
                                            refusal:
                                              type: string
                                              description: >-
                                                The refusal message generated by the
                                                model.
                                            type:
                                              type: string
                                              enum:
                                                - refusal
                                              description: The type of the content part.
                                          required:
                                            - refusal
                                            - type
                                    description: >-
                                      An array of content parts with a defined
                                      type. Can be one or more of type text, or
                                      exactly one of type refusal.
                                  - nullable: true
                                description: >-
                                  The contents of the Assistant message.
                                  Required unless tool_calls or function_call is
                                  specified.
                              name:
                                type: string
                                description: >-
                                  An optional name for the participant. Provides
                                  the model information to differentiate between
                                  participants of the same role.
                              tool_calls:
                                type: array
                                items:
                                  oneOf:
                                    - type: object
                                      properties:
                                        id:
                                          type: string
                                          description: The ID of the tool call.
                                        type:
                                          type: string
                                          enum:
                                            - function
                                          description: >-
                                            The type of the tool. Currently, only
                                            function is supported.
                                        function:
                                          type: object
                                          properties:
                                            name:
                                              type: string
                                              description: The name of the function to call.
                                            arguments:
                                              type: string
                                              description: >-
                                                The arguments to call the function with,
                                                as generated by the model in JSON
                                                format. Note that the model does not
                                                always generate valid JSON, and may
                                                hallucinate parameters not defined by
                                                your function schema. Validate the
                                                arguments in your code before calling
                                                your function.
                                          required:
                                            - name
                                            - arguments
                                          description: The function that the model called.
                                        extra_content:
                                          type: object
                                          additionalProperties:
                                            nullable: true
                                          description: >-
                                            Opaque provider metadata for this tool
                                            call (e.g. Gemini thought_signature).
                                            Echo it back unchanged on the next turn.
                                      required:
                                        - id
                                        - type
                                        - function
                                    - type: object
                                      properties:
                                        id:
                                          type: string
                                          description: The ID of the tool call.
                                        type:
                                          type: string
                                          enum:
                                            - custom
                                          description: >-
                                            The type of the tool. Currently, only
                                            function is supported.
                                        custom:
                                          type: object
                                          properties:
                                            name:
                                              type: string
                                              description: The name of the custom tool to call.
                                            input:
                                              type: string
                                              description: >-
                                                The input for the custom tool call
                                                generated by the model.
                                          required:
                                            - name
                                            - input
                                          description: The custom tool that the model called.
                                        extra_content:
                                          type: object
                                          additionalProperties:
                                            nullable: true
                                          description: >-
                                            Opaque provider metadata for this tool
                                            call (e.g. Gemini thought_signature).
                                            Echo it back unchanged on the next turn.
                                      required:
                                        - id
                                        - type
                                        - custom
                                description: >-
                                  The tool calls generated by the model, such as
                                  function calls.
                              refusal:
                                type: string
                                nullable: true
                                description: The refusal message by the Assistant.
                            required:
                              - role
                      description: >-
                        A list of messages comprising the conversation so far.
                        Depending on the model you use, different message types
                        (modalities) are supported, like text, documents (txt,
                        pdf), images, and audio.
                    max_completion_tokens:
                      type: integer
                      minimum: 1
                      description: >-
                        An upper bound for the number of tokens that can be
                        generated for a completion, including visible output
                        tokens and reasoning tokens.
                    max_tokens:
                      type: number
                      minimum: 1
                      description: >-
                        The maximum number of tokens that can be generated in
                        the chat completion. This value can be used to control
                        costs for text generated via API.
                    stream:
                      type: boolean
                      default: false
                      description: >-
                        If set to True, the model response data will be streamed
                        to the client as it is generated using server-sent
                        events.
                    stream_options:
                      type: object
                      properties:
                        include_usage:
                          type: boolean
                      required:
                        - include_usage
                    tools:
                      type: array
                      items:
                        anyOf:
                          - oneOf:
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - function
                                    description: >-
                                      The type of the tool. Currently, only
                                      function is supported.
                                  function:
                                    type: object
                                    properties:
                                      description:
                                        type: string
                                        description: >-
                                          A description of what the function does,
                                          used by the model to choose when and how
                                          to call the function.
                                      name:
                                        type: string
                                        description: >-
                                          The name of the function to be called.
                                          Must be a-z, A-Z, 0-9, or contain
                                          underscores and dashes, with a maximum
                                          length of 64.
                                      parameters:
                                        type: object
                                        additionalProperties:
                                          nullable: true
                                          description: >-
                                            The parameters the functions accepts,
                                            described as a JSON Schema object.
                                      strict:
                                        type: boolean
                                        nullable: true
                                        description: >-
                                          Whether to enable strict schema
                                          adherence when generating the function
                                          call. If set to True, the model will
                                          follow the exact schema defined in the
                                          parameters field. Only a subset of JSON
                                          Schema is supported when strict is True.
                                    required:
                                      - name
                                  cache_control:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - ephemeral
                                      ttl:
                                        type: string
                                        enum:
                                          - 5m
                                          - 1h
                                    required:
                                      - type
                                required:
                                  - type
                                  - function
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - custom
                                    description: >-
                                      The type of the tool. Currently, only
                                      function is supported.
                                  custom:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                        description: >-
                                          The name of the custom tool, used to
                                          identify it in tool calls.
                                      description:
                                        type: string
                                        description: >-
                                          Optional description of the custom tool,
                                          used to provide more context.
                                      format:
                                        oneOf:
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - text
                                            required:
                                              - type
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - grammar
                                              grammar:
                                                type: object
                                                properties:
                                                  definition:
                                                    type: string
                                                    description: The grammar definition.
                                                  syntax:
                                                    type: string
                                                    enum:
                                                      - lark
                                                      - regex
                                                    description: The syntax of the grammar definition.
                                                required:
                                                  - definition
                                                  - syntax
                                            required:
                                              - type
                                              - grammar
                                        description: >-
                                          The input format for the custom tool.
                                          Default is unconstrained text.
                                    required:
                                      - name
                                      - format
                                  cache_control:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - ephemeral
                                      ttl:
                                        type: string
                                        enum:
                                          - 5m
                                          - 1h
                                    required:
                                      - type
                                required:
                                  - type
                                  - custom
                          - type: object
                            properties:
                              type:
                                type: string
                                minLength: 1
                            required:
                              - type
                      description: >-
                        A list of tools the model may call. Currently, only
                        functions are supported as a tool. Use this to provide a
                        list of functions the model may generate JSON inputs
                        for. A max of 128 functions are supported.
                    tool_choice:
                      anyOf:
                        - type: string
                          enum:
                            -

# --- truncated at 32 KB (8732 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/aimlapi/refs/heads/main/openapi/aimlapi-inference-openapi.yml