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

# Invoke an LLM

> Non-streaming generation. The response body is the requested text or JSON value, without an envelope. The authenticated API key's organization pays; optional user_id/session_id provide attribution only. X-Request-ID, X-Credits-Used and X-LLM-Model response headers describe the call.



## OpenAPI

````yaml /openapi.json post /llm/invoke
openapi: 3.1.0
info:
  title: Overten API
  version: 1.0.0
  description: >-
    Generate and edit Word, Excel, and PowerPoint documents programmatically.
    Powered by the same agents as the Overten web app.
  contact:
    name: Overten Support
    url: https://overten.ai/support
    email: support@overten.ai
  license:
    name: Terms of Service
    url: https://overten.ai/terms
servers:
  - url: https://backend.overtenai.com/api/v1
    description: Production
  - url: http://localhost:8000/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /llm/invoke:
    post:
      tags:
        - public
        - llm
      summary: Invoke an LLM
      description: >-
        Non-streaming generation. The response body is the requested text or
        JSON value, without an envelope. The authenticated API key's
        organization pays; optional user_id/session_id provide attribution only.
        X-Request-ID, X-Credits-Used and X-LLM-Model response headers describe
        the call.
      operationId: invoke_api_v1_llm_invoke_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMInvokeRequest'
            examples:
              text:
                summary: Return text
                value:
                  messages:
                    - role: user
                      content: Say hello.
              json:
                summary: Return JSON
                value:
                  messages:
                    - role: user
                      content: Return the JSON array [1, 2, 3].
                  response_format:
                    type: json
              json_schema:
                summary: Return a JSON object matching a schema
                value:
                  messages:
                    - role: user
                      content: 'Classify this review: The service was excellent.'
                  response_format:
                    type: json_schema
                    json_schema:
                      type: object
                      properties:
                        sentiment:
                          type: string
                          enum:
                            - positive
                            - negative
                      required:
                        - sentiment
                      additionalProperties: false
        required: true
      responses:
        '200':
          description: >-
            Consumer-defined output: text/plain for text, application/json for
            JSON modes.
          headers:
            X-Request-ID:
              schema:
                type: string
            X-Credits-Used:
              schema:
                type: integer
            X-LLM-Model:
              schema:
                type: string
          content:
            application/json:
              schema: {}
              examples:
                object:
                  value:
                    sentiment: positive
                array:
                  value:
                    - 1
                    - 2
                    - 3
            text/plain:
              schema:
                type: string
              example: Hello.
        '401':
          description: Invalid API key
        '402':
          description: Insufficient organization API credits or exceeded LLM budget
        '403':
          description: Insufficient permissions
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded
        '502':
          description: Model failure, invalid output or unavailable usage accounting
        '504':
          description: Model timeout
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: Return text
          source: >-
            curl -sS -w '\n' --request POST
            "https://backend.overtenai.com/api/v1/llm/invoke" \
              -H "X-API-Key: $OVERTEN_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "messages": [
                {
                  "role": "user",
                  "content": "Say hello."
                }
              ]
            }'
        - lang: bash
          label: Return JSON
          source: >-
            curl -sS -w '\n' --request POST
            "https://backend.overtenai.com/api/v1/llm/invoke" \
              -H "X-API-Key: $OVERTEN_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "messages": [
                {
                  "role": "user",
                  "content": "Return the JSON array [1, 2, 3]."
                }
              ],
              "response_format": {
                "type": "json"
              }
            }' | jq .
        - lang: bash
          label: Return a JSON object matching a schema
          source: >-
            curl -sS -w '\n' --request POST
            "https://backend.overtenai.com/api/v1/llm/invoke" \
              -H "X-API-Key: $OVERTEN_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "messages": [
                {
                  "role": "user",
                  "content": "Classify this review: The service was excellent."
                }
              ],
              "response_format": {
                "type": "json_schema",
                "json_schema": {
                  "type": "object",
                  "properties": {
                    "sentiment": {
                      "type": "string",
                      "enum": [
                        "positive",
                        "negative"
                      ]
                    }
                  },
                  "required": [
                    "sentiment"
                  ],
                  "additionalProperties": false
                }
              }
            }' | jq .
components:
  schemas:
    LLMInvokeRequest:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/LLMMessage'
          type: array
          minItems: 1
          title: Messages
        response_format:
          $ref: '#/components/schemas/LLMResponseFormat'
        model:
          anyOf:
            - type: string
            - type: 'null'
          enum:
            - null
            - DeepSeek-V4-Pro
            - Kimi-K2.6
            - auto
            - azure/gpt-5.4
            - azure/gpt-5.4-mini
            - claude-opus-4-6
            - claude-sonnet-4-6
            - deepseek/deepseek-v4-flash-0731
            - gemini-3.8-flash
            - qwen/qwen3.7-max
            - z-ai/glm-5.2
            - z-ai/glm-5.3-flash
          title: Model
          description: >-
            Supported model ID, or auto for backend defaults. Fallback may use
            another configured model.
        user_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: User Id
          description: Optional end-user attribution; the API key's organization pays.
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
          description: >-
            Optional session for grouping usage. Does not restore conversation
            history.
      additionalProperties: false
      type: object
      required:
        - messages
      title: LLMInvokeRequest
      examples:
        - messages:
            - content: Say hello.
              role: user
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LLMMessage:
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          title: Role
        content:
          type: string
          minLength: 1
          title: Content
      additionalProperties: false
      type: object
      required:
        - role
        - content
      title: LLMMessage
    LLMResponseFormat:
      properties:
        type:
          type: string
          enum:
            - text
            - json
            - json_schema
          title: Type
          default: text
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
          description: >-
            JSON Schema (2020-12) for the returned value. Required for
            json_schema mode.
      additionalProperties: false
      type: object
      title: LLMResponseFormat
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Send `X-API-Key: sk_live_<your_key>`. Keys are issued via POST /signup
        or via the dashboard. Legacy callers may also use `Authorization: Bearer
        sk_live_<your_key>`.

````