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

# Create completion

> Creates a text completion for the given prompt. Supports streaming via SSE.




## OpenAPI

````yaml /api-reference/corti-models/corti-models-openapi.yml post /completions
openapi: 3.0.3
info:
  title: Corti S1 API
  description: >
    OpenAI-compatible and Anthropic-compatible API for Corti's LLM models.

    ## Available Models

    | Model | Description | |------|-------------| | `corti-s1` |
    Full-capability model | | `corti-s1-instant` | Fast variant of corti-s1 | |
    `corti-s1-mini` | Smaller model | | `corti-s1-mini-instant` | Fast variant
    of corti-s1-mini |

    `-instant` variants are optimized for speed and lower token usage.

    ## Reasoning

    Some models return chain-of-thought reasoning in a `reasoning` field (chat
    completions) or as structured output items with `type: "reasoning"`
    (responses API). The `-instant` variants do not produce reasoning.

    | Model | Chat Completions | Anthropic Messages | |-------|:---:|:---:| |
    `corti-s1` | `reasoning` field present | Text content only | |
    `corti-s1-instant` | `reasoning: null` | Text content only | |
    `corti-s1-mini` | `reasoning` field present | Text content only | |
    `corti-s1-mini-instant` | `reasoning: null` | Text content only |

    ## Authentication

    All endpoints require a bearer token issued by Corti. Pass it in the
    `Authorization` header as `Bearer <token>`.
  version: 1.0.0
  contact:
    name: Corti AI
    url: https://corti.app
servers:
  - url: https://ai.eu.corti.app/v1
    description: Production (EU)
security:
  - bearerAuth: []
paths:
  /completions:
    post:
      tags:
        - Completions
      summary: Create completion
      description: >
        Creates a text completion for the given prompt. Supports streaming via
        SSE.
      operationId: createCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionRequest'
            examples:
              Basic:
                summary: Basic completion
                value:
                  model: corti-s1
                  prompt: The capital of France is
                  max_tokens: 50
              Streaming:
                summary: Streaming completion
                value:
                  model: corti-s1
                  prompt: The capital of Denmark is
                  max_tokens: 50
                  stream: true
      responses:
        '200':
          description: >
            Successful response. For non-streaming requests, returns a complete
            text completion. For streaming requests, returns Server-Sent Events
            (SSE) with incremental text chunks. Terminates with `data: [DONE]`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompletionResponse'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/CompletionStreamResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CompletionRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - corti-s1
            - corti-s1-instant
            - corti-s1-mini
            - corti-s1-mini-instant
          default: corti-s1
        prompt:
          oneOf:
            - type: string
              description: Single prompt string.
            - type: array
              items:
                type: string
              description: Batch of prompt strings.
        stream:
          type: boolean
          default: false
          description: >
            If true, returns SSE with `data: {chunk}` lines. Terminates with
            `data: [DONE]`.
        temperature:
          type: number
          format: float
          minimum: 0
          maximum: 1
          default: 1
        top_p:
          type: number
          format: float
          default: 0.95
        max_tokens:
          type: integer
          minimum: 1
          description: Maximum tokens to generate.
        logprobs:
          type: boolean
          default: false
        top_logprobs:
          type: integer
          minimum: 0
          maximum: 20
    CompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique completion ID (e.g. `cmpl-8acdd476-...`).
        object:
          type: string
          enum:
            - text_completion
        created:
          type: integer
          description: Unix timestamp (seconds).
        model:
          type: string
          description: The model name used for this response.
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              text:
                type: string
                description: The completion text.
              logprobs:
                type: object
                nullable: true
              prompt_logprobs:
                type: object
                nullable: true
              prompt_token_ids:
                type: array
                nullable: true
                items:
                  type: integer
              token_ids:
                type: array
                nullable: true
                items:
                  type: integer
              routed_experts:
                type: array
                nullable: true
                items: {}
              stop_reason:
                type: integer
                nullable: true
                description: Stop reason code.
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
        system_fingerprint:
          type: string
          nullable: true
        service_tier:
          type: string
          nullable: true
        kv_transfer_params:
          type: object
          nullable: true
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
            prompt_tokens_details:
              type: object
              nullable: true
    CompletionStreamResponse:
      type: object
      description: 'SSE chunk. Stream terminates with `data: [DONE]`.'
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - text_completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              text:
                type: string
                nullable: true
                description: Incremental text token(s).
              logprobs:
                type: object
                nullable: true
              finish_reason:
                type: string
                nullable: true
                enum:
                  - stop
                  - length
              stop_reason:
                type: integer
                nullable: true
              prompt_token_ids:
                type: array
                nullable: true
                items:
                  type: integer
              token_ids:
                type: array
                nullable: true
                items:
                  type: integer
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message or object with message.
        detail:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Use a Corti-issued bearer token.

````