.txt models API

List and retrieve information about available models. Use these endpoints to discover which models you have access to and their capabilities.

OpenAPI Specification

txt-models-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: dottxt batches models API
  description: The dottxt API
  version: 1.0.0
servers:
- url: https://api.dottxt.ai/v1
  description: dottxt API
tags:
- name: models
  description: 'List and retrieve information about available models.


    Use these endpoints to discover which models you have access to and their capabilities.'
paths:
  /models:
    get:
      tags:
      - models
      summary: List models
      description: 'Lists the models available to your API key.


        The response includes model IDs that can be used in chat completion and embedding requests.'
      operationId: list_models
      responses:
        '200':
          description: List of models your API key can access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsListResponse'
        '401':
          description: Invalid or missing API key. Ensure your `Authorization` header is set to `Bearer YOUR_API_KEY`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
      security:
      - BearerAuth: []
  /models/{model}:
    get:
      tags:
      - models
      summary: Retrieve model
      description: Retrieves information about a specific model.
      operationId: get_model
      parameters:
      - name: model
        in: path
        description: The model ID (e.g., `gpt-4`, `text-embedding-ada-002`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Model details including ID, owner, and creation timestamp.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelObject'
        '401':
          description: Invalid or missing API key. Ensure your `Authorization` header is set to `Bearer YOUR_API_KEY`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '404':
          description: The specified model does not exist or you don't have access to it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
      security:
      - BearerAuth: []
components:
  schemas:
    OpenAIErrorResponse:
      type: object
      description: OpenAI-compatible error response.
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/OpenAIError'
          description: The error details.
      example:
        error:
          code: invalid_api_key
          message: Invalid API key provided
          type: authentication_error
    ModelObject:
      type: object
      description: A model object.
      required:
      - id
      - object
      - created
      - owned_by
      properties:
        created:
          type: integer
          format: int64
          description: The Unix timestamp of when the model was created.
          example: 1703187200
        id:
          type: string
          description: The model identifier.
          example: Qwen/Qwen3-30B-A3B-FP8
        object:
          type: string
          description: The object type, always "model".
          example: model
        owned_by:
          type: string
          description: The organization that owns the model.
          example: qwen
      example:
        created: 1703187200
        id: Qwen/Qwen3-30B-A3B-FP8
        object: model
        owned_by: qwen
    ModelsListResponse:
      type: object
      description: Response for listing available models.
      required:
      - object
      - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ModelObject'
          description: The list of available models.
        object:
          type: string
          description: The object type, always "list".
          example: list
      example:
        data:
        - created: 1703187200
          id: Qwen/Qwen3-30B-A3B-FP8
          object: model
          owned_by: qwen
        object: list
    OpenAIError:
      type: object
      description: OpenAI-compatible error details.
      required:
      - message
      - type
      properties:
        code:
          type:
          - string
          - 'null'
          description: The error code.
          example: invalid_api_key
        message:
          type: string
          description: The error message.
          example: Invalid API key provided
        param:
          type:
          - string
          - 'null'
          description: The parameter that caused the error, if applicable.
        type:
          type: string
          description: The type of error.
          example: authentication_error
      example:
        code: invalid_api_key
        message: Invalid API key provided
        type: authentication_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API key authentication. Include your key in the `Authorization` header:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        API keys can be created and managed in the dashboard.'