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

# Create response

> OpenAI-Responses-compatible endpoint. The request body is a passthrough to the Inference Engine — every field the caller sends flows through, so any Responses API field the backend model accepts (input content parts, instructions, `response_format`, tools, streaming, temperature, `max_output_tokens`, …) can be used.

Tenant model-policy applies: models not on the caller's tenant allowlist return `409` with error code `model_blocked`.

Tenant-owned provider keys (`OpenAI`, `Anthropic`, `Gemini`, `Groq`, `SambaNova`, `Cohere`) are auto-resolved and injected on the outbound call per the standard resolution order (user → sub-org → org → system); explicit `X-User-*-Key` request headers still take precedence.




## OpenAPI

````yaml /openapi.yaml post /v1/responses
openapi: 3.1.0
info:
  title: Co-mind.ai Private AI Platform API
  version: 1.2.4
  description: >
    Co-mind.ai Private AI Platform API.


    ## Features

    - OpenAI-compatible endpoints

    - Tool/function calling support

    - Streaming responses

    - Multiple backend support

    - Personal Access Tokens (PAT) for programmatic access


    ## Authentication

    The API supports two authentication methods:


    **1. JWT Authentication** — Login with email/password to get short-lived
    access tokens.

    Use for interactive sessions (web apps, Postman).


    **2. Personal Access Tokens (PAT)** — Long-lived tokens for programmatic/API
    access.

    Create via `POST /v1/api-tokens` after authenticating with JWT.

    PAT format: `cmnd_<tokenId>.<secret>`


    Both methods use the `Authorization: Bearer <token>` header.
  contact:
    email: support@co-mind.ai
servers:
  - url: http://co-mind-platform-host
    description: Co-mind.ai AI Platform
security:
  - BearerAuth: []
tags:
  - name: Discovery
    description: List available models
  - name: Authentication
    description: >-
      JWT login, refresh, logout, SSO, registration, password reset, and
      `/v1/auth/me`
  - name: API Tokens
    description: Personal Access Token (PAT) management
  - name: Completions
    description: Text completion endpoints (single-shot, no conversation state)
  - name: Chat
    description: >
      OpenAI-compatible chat completions. **Stateless** — the client sends the
      full conversation history on every request; the server does not persist
      messages.
  - name: Responses
    description: >
      OpenAI-Responses-compatible endpoint. Wire-shape passthrough to the
      Inference Engine — every field the caller sends flows through, so the
      caller can use the full Responses API surface. The server does not persist
      responses server-side; use the `/v1/responses/{resp_id}/continue` variant
      to extend a prior response by id.
  - name: Embeddings
    description: >
      Text-embedding endpoint. Runs against the platform's configured embedding
      model (see `GET /v1/models`); the resulting vectors are returned to the
      caller and are not persisted server-side.
  - name: Translation
    description: >
      Text translation between languages. Ships with `POST /v1/translate/text`;
      async document translation is on the roadmap for a future release.
  - name: Knowledge Base
    description: >
      Knowledge base management (create / update / delete KBs, upload files,
      query for context) and **stateless** retrieval-augmented chat
      (`/v1/knowledgebase/chat/completions`). The RAG chat endpoint is stateless
      — the client sends the full conversation history on every request; the
      server injects retrieved KB context and returns the completion.
  - name: Chat Sessions (Preview)
    description: >
      **Preview — not currently enabled.**


      **Stateful** chat sessions. The server manages conversation history and
      supports tool orchestration (knowledge base retrieval, research, agents).
      These endpoints are documented for integrator preparation but are not
      exposed on any deployment today; they will be enabled in an upcoming
      release. Request and response schemas may change before general
      availability.
  - name: Researcher
    description: Web search, research sessions, analysis, synthesis, and source credibility
  - name: Quota
    description: Usage quota tracking
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Create response
      description: >
        OpenAI-Responses-compatible endpoint. The request body is a passthrough
        to the Inference Engine — every field the caller sends flows through, so
        any Responses API field the backend model accepts (input content parts,
        instructions, `response_format`, tools, streaming, temperature,
        `max_output_tokens`, …) can be used.


        Tenant model-policy applies: models not on the caller's tenant allowlist
        return `409` with error code `model_blocked`.


        Tenant-owned provider keys (`OpenAI`, `Anthropic`, `Gemini`, `Groq`,
        `SambaNova`, `Cohere`) are auto-resolved and injected on the outbound
        call per the standard resolution order (user → sub-org → org → system);
        explicit `X-User-*-Key` request headers still take precedence.
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: Model refused by the caller's tenant model-policy allowlist
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                        example: policy_error
                      code:
                        type: string
                        example: model_blocked
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    ResponsesRequest:
      type: object
      required:
        - input
        - model
      additionalProperties: true
      properties:
        model:
          type: string
          example: gpt-4o-mini
        input:
          description: >
            The prompt or conversation input. Accepts either a plain string or
            an array of typed content parts (text, input_image, input_file, …)
            per the Responses API shape supported by the backend model.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
        instructions:
          type: string
          description: Optional system-style instructions applied to the response.
        max_output_tokens:
          type: integer
          minimum: 1
        temperature:
          type: number
          minimum: 0
          maximum: 2
        top_p:
          type: number
          minimum: 0
          maximum: 1
        stream:
          type: boolean
          default: false
        previous_response_id:
          type: string
          description: >-
            Id of a prior response to continue. Callers can also POST to
            `/v1/responses/{resp_id}/continue`.
    ResponsesResponse:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          example: resp_abc123
        object:
          type: string
          example: response
        created:
          type: integer
        model:
          type: string
        output:
          description: >
            Model output. Shape depends on the backend and on whether `stream`
            was requested; for non-streaming calls this is typically an array of
            content parts (or a compact `output_text` string alongside them).
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
        usage:
          $ref: '#/components/schemas/Usage'
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid request parameters
              type: invalid_request_error
              code: bad_request
    Unauthorized:
      description: Authentication required or invalid token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid authentication credentials
              type: permission_error
              code: unauthorized
    RateLimitExceeded:
      description: Rate limit exceeded
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying
        x-ratelimit-limit-requests:
          schema:
            type: integer
        x-ratelimit-remaining-requests:
          schema:
            type: integer
        x-ratelimit-reset-requests:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit exceeded
              type: rate_limit_exceeded
              code: rate_limit_exceeded
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or PAT
      description: >
        Bearer token authentication. Supports two token types:

        - **JWT Access Token** — obtained via `POST /v1/auth/login`

        - **Personal Access Token (PAT)** — created via `POST /v1/api-tokens`,
        format: `cmnd_<tokenId>.<secret>`

````