openapi: "3.1.0"
info:
  title: "Nemo Router API"
  version: "1.0.0"
  description: "One key, one bill, every model. Call any LLM — text, image, audio, embeddings — through a single OpenAI-compatible endpoint. Authenticate with your virtual key (sk-nemo-…)."
servers:
  -
    url: "https://api.nemorouter.ai"
    description: "Production"
security:
  -
    NemoApiKey: []
tags:
  -
    name: "text"
    description: "Chat + text completions"
  -
    name: "image"
    description: "Image generation + edits"
  -
    name: "audio"
    description: "Speech synthesis + transcription"
  -
    name: "video"
    description: "Video generation"
  -
    name: "utility"
    description: "Embeddings, rerank, moderations, OCR, models"
paths:
  "/v1/chat/completions":
    post:
      summary: "Create a chat completion (streaming or not)."
      description: "Create a chat completion (streaming or not)."
      operationId: "post_v1_chat_completions"
      tags:
        - "text"
      x-nemo-modality: "text"
      x-nemo-features:
        - "guardrails"
        - "prompts"
        - "ab_testing"
        - "credits"
        - "cache"
      x-nemo-sdk: "chat.completions.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                id: "chatcmpl-abc123"
                object: "chat.completion"
                model: "gpt-4o"
                choices:
                  -
                    index: 0
                    message:
                      role: "assistant"
                      content: "Hello!"
                    finish_reason: "stop"
                usage:
                  prompt_tokens: 9
                  completion_tokens: 2
                  total_tokens: 11
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "messages"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                messages:
                  type: "array"
                  items:
                    type: "object"
                    required:
                      - "role"
                      - "content"
                    properties:
                      role:
                        type: "string"
                        enum:
                          - "system"
                          - "user"
                          - "assistant"
                          - "tool"
                      content:
                        oneOf:
                          -
                            type: "string"
                          -
                            type: "array"
                            items:
                              type: "object"
                temperature:
                  type: "number"
                  minimum: 0
                  maximum: 2
                  default: 1
                max_tokens:
                  type: "integer"
                  minimum: 1
                n:
                  type: "integer"
                  minimum: 1
                  default: 1
                stream:
                  type: "boolean"
                  default: false
                response_format:
                  type: "object"
                  description: "e.g. { \"type\": \"json_object\" } for JSON mode."
                tools:
                  type: "array"
                  items:
                    type: "object"
                  description: "Function/tool definitions for tool calling."
                tool_choice:
                  description: "auto | none | required, or a specific tool."
  "/v1/completions":
    post:
      summary: "Create a text completion (legacy prompt format)."
      description: "Create a text completion (legacy prompt format)."
      operationId: "post_v1_completions"
      tags:
        - "text"
      x-nemo-modality: "text"
      x-nemo-features:
        - "credits"
        - "cache"
      x-nemo-sdk: "completions.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                id: "cmpl-abc123"
                object: "text_completion"
                model: "gpt-4o-mini"
                choices:
                  -
                    text: " there!"
                    index: 0
                    finish_reason: "stop"
                usage:
                  prompt_tokens: 2
                  completion_tokens: 2
                  total_tokens: 4
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "prompt"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                prompt:
                  type: "string"
                max_tokens:
                  type: "integer"
                  minimum: 1
                  default: 16
                temperature:
                  type: "number"
                  minimum: 0
                  maximum: 2
                  default: 1
  "/v1/embeddings":
    post:
      summary: "Create an embedding vector for input text."
      description: "Create an embedding vector for input text."
      operationId: "post_v1_embeddings"
      tags:
        - "utility"
      x-nemo-modality: "utility"
      x-nemo-features:
        - "credits"
        - "cache"
      x-nemo-sdk: "embeddings.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                object: "list"
                model: "text-embedding-3-small"
                data:
                  -
                    object: "embedding"
                    index: 0
                    embedding:
                      - 0.0023
                      - -0.009
                      - 0.015
                usage:
                  prompt_tokens: 5
                  total_tokens: 5
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "input"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                input:
                  oneOf:
                    -
                      type: "string"
                    -
                      type: "array"
                      items:
                        type: "string"
  "/v1/images/generations":
    post:
      summary: "Generate an image from a text prompt."
      description: "Generate an image from a text prompt."
      operationId: "post_v1_images_generations"
      tags:
        - "image"
      x-nemo-modality: "image"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "images.generate()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                created: 1700000000
                data:
                  -
                    b64_json: "<base64-png>"
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "prompt"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                prompt:
                  type: "string"
                size:
                  type: "string"
                  enum:
                    - "1024x1024"
                    - "1024x1536"
                    - "1536x1024"
                  default: "1024x1024"
                n:
                  type: "integer"
                  minimum: 1
                  maximum: 4
                  default: 1
  "/v1/images/edits":
    post:
      summary: "Edit an image given a source image (+ optional mask) and a prompt."
      description: "Edit an image given a source image (+ optional mask) and a prompt."
      operationId: "post_v1_images_edits"
      tags:
        - "image"
      x-nemo-modality: "image"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "images.edit()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                created: 1700000000
                data:
                  -
                    b64_json: "<base64-png>"
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "multipart/form-data":
            schema:
              type: "object"
              required:
                - "image"
                - "prompt"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                image:
                  type: "string"
                  format: "binary"
                  description: "Source image file."
                mask:
                  type: "string"
                  format: "binary"
                  description: "Optional transparency mask."
                prompt:
                  type: "string"
  "/v1/videos":
    post:
      summary: "Generate a video from a text prompt (async)."
      description: "Generate a video from a text prompt (async)."
      operationId: "post_v1_videos"
      tags:
        - "video"
      x-nemo-modality: "video"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "videos.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                id: "video_abc123"
                object: "video.generation"
                status: "queued"
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "prompt"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                prompt:
                  type: "string"
                seconds:
                  type: "integer"
                  minimum: 1
                  description: "Target duration in seconds (model-dependent)."
                size:
                  type: "string"
                  description: "Resolution, e.g. 1280x720 (model-dependent)."
  "/v1/audio/speech":
    post:
      summary: "Synthesize speech audio from text (TTS)."
      description: "Synthesize speech audio from text (TTS)."
      operationId: "post_v1_audio_speech"
      tags:
        - "audio"
      x-nemo-modality: "audio"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "audio.speech.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "audio/mpeg":
              schema:
                type: "string"
                format: "binary"
              example: "audio/mpeg bytes (rendered as an <audio> player)"
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "input"
                - "voice"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                input:
                  type: "string"
                voice:
                  type: "string"
                  description: "Voice id (provider-specific)."
                response_format:
                  type: "string"
                  enum:
                    - "mp3"
                    - "wav"
                    - "opus"
                  default: "mp3"
  "/v1/audio/transcriptions":
    post:
      summary: "Transcribe an uploaded audio file to text (STT)."
      description: "Transcribe an uploaded audio file to text (STT)."
      operationId: "post_v1_audio_transcriptions"
      tags:
        - "audio"
      x-nemo-modality: "audio"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "audio.transcriptions.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                text: "The transcribed speech."
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "multipart/form-data":
            schema:
              type: "object"
              required:
                - "model"
                - "file"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                file:
                  type: "string"
                  format: "binary"
                  description: "Audio file (mp3/wav/m4a…)."
                language:
                  type: "string"
                  description: "Optional ISO-639-1 hint."
  "/v1/moderations":
    post:
      summary: "Classify whether text violates content policy."
      description: "Classify whether text violates content policy."
      operationId: "post_v1_moderations"
      tags:
        - "utility"
      x-nemo-modality: "utility"
      x-nemo-features: []
      x-nemo-sdk: "moderations.create()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                id: "modr-abc123"
                model: "omni-moderation-latest"
                results:
                  -
                    flagged: false
                    categories:
                      violence: false
                    category_scores:
                      violence: 0.001
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "input"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                input:
                  type: "string"
  "/v1/rerank":
    post:
      summary: "Rerank documents by relevance to a query."
      description: "Rerank documents by relevance to a query."
      operationId: "post_v1_rerank"
      tags:
        - "utility"
      x-nemo-modality: "utility"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "POST /v1/rerank"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                id: "rerank-abc123"
                results:
                  -
                    index: 1
                    relevance_score: 0.98
                  -
                    index: 0
                    relevance_score: 0.41
                meta:
                  billed_units:
                    search_units: 1
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "query"
                - "documents"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                query:
                  type: "string"
                documents:
                  type: "array"
                  items:
                    type: "string"
                top_n:
                  type: "integer"
                  minimum: 1
  "/v1/ocr":
    post:
      summary: "Extract text + structure from a document."
      description: "Extract text + structure from a document."
      operationId: "post_v1_ocr"
      tags:
        - "utility"
      x-nemo-modality: "utility"
      x-nemo-features:
        - "credits"
      x-nemo-sdk: "POST /v1/ocr"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                pages:
                  -
                    index: 0
                    markdown: "# Heading\n\nbody…"
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              required:
                - "model"
                - "document"
              properties:
                model:
                  type: "string"
                  description: "Model id (see GET /v1/models)."
                document:
                  type: "string"
                  description: "Document URL or base64 data URI."
  "/v1/models":
    get:
      summary: "List the models available to your key."
      description: "List the models available to your key."
      operationId: "get_v1_models"
      tags:
        - "utility"
      x-nemo-modality: "utility"
      x-nemo-features:
        - "cache"
      x-nemo-sdk: "models.list()"
      responses:
        200:
          description: "Success"
          headers:
            x-nemo-request-id:
              description: "Unique request ID"
              schema:
                type: "string"
            x-nemo-request-cost:
              description: "Exact cost in USD"
              schema:
                type: "number"
            x-nemo-guardrails-applied:
              description: "Guardrails that ran on this request"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-prompt-version:
              description: "Prompt template version injected"
              schema:
                type: "integer"
            x-nemo-ab-test:
              description: "A/B test variant selected"
              schema:
                type: "string"
            x-nemo-post-call-guardrails:
              description: "Post-call guardrails that ran"
              schema:
                type: "string"
                description: "Comma-separated values."
            x-nemo-stream-buffered:
              description: "Stream buffered for guardrails"
              schema:
                type: "boolean"
            x-nemo-cache:
              description: "Cache hit/miss (models endpoint)"
              schema:
                type: "string"
            x-nemo-latency-ms:
              description: "Server-side latency in milliseconds"
              schema:
                type: "number"
          content:
            "application/json":
              schema:
                type: "object"
              example:
                object: "list"
                data:
                  -
                    id: "gpt-4o"
                    object: "model"
                    owned_by: "nemorouter"
        400:
          "$ref": "#/components/responses/error_400"
        402:
          "$ref": "#/components/responses/error_402"
        429:
          "$ref": "#/components/responses/error_429"
        503:
          "$ref": "#/components/responses/error_503"
components:
  securitySchemes:
    NemoApiKey:
      type: "http"
      scheme: "bearer"
      description: "Your Nemo Router virtual key (sk-nemo-…). Sent as `Authorization: Bearer sk-nemo-…`."
  responses:
    error_400:
      description: "400 — Guardrail blocked the request"
      headers:
        x-nemo-request-id:
          description: "Unique request ID"
          schema:
            type: "string"
        x-nemo-request-cost:
          description: "Exact cost in USD"
          schema:
            type: "number"
        x-nemo-guardrails-applied:
          description: "Guardrails that ran on this request"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-prompt-version:
          description: "Prompt template version injected"
          schema:
            type: "integer"
        x-nemo-ab-test:
          description: "A/B test variant selected"
          schema:
            type: "string"
        x-nemo-post-call-guardrails:
          description: "Post-call guardrails that ran"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-stream-buffered:
          description: "Stream buffered for guardrails"
          schema:
            type: "boolean"
        x-nemo-cache:
          description: "Cache hit/miss (models endpoint)"
          schema:
            type: "string"
        x-nemo-latency-ms:
          description: "Server-side latency in milliseconds"
          schema:
            type: "number"
      content:
        "application/json":
          schema:
            type: "object"
            properties:
              error:
                type: "object"
                properties:
                  type:
                    type: "string"
                    enum:
                      - "guardrail_blocked"
                    example: "guardrail_blocked"
                  message:
                    type: "string"
                    example: "Guardrail blocked the request"
    error_402:
      description: "402 — Not enough credits"
      headers:
        x-nemo-request-id:
          description: "Unique request ID"
          schema:
            type: "string"
        x-nemo-request-cost:
          description: "Exact cost in USD"
          schema:
            type: "number"
        x-nemo-guardrails-applied:
          description: "Guardrails that ran on this request"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-prompt-version:
          description: "Prompt template version injected"
          schema:
            type: "integer"
        x-nemo-ab-test:
          description: "A/B test variant selected"
          schema:
            type: "string"
        x-nemo-post-call-guardrails:
          description: "Post-call guardrails that ran"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-stream-buffered:
          description: "Stream buffered for guardrails"
          schema:
            type: "boolean"
        x-nemo-cache:
          description: "Cache hit/miss (models endpoint)"
          schema:
            type: "string"
        x-nemo-latency-ms:
          description: "Server-side latency in milliseconds"
          schema:
            type: "number"
      content:
        "application/json":
          schema:
            type: "object"
            properties:
              error:
                type: "object"
                properties:
                  type:
                    type: "string"
                    enum:
                      - "insufficient_credits"
                    example: "insufficient_credits"
                  message:
                    type: "string"
                    example: "Not enough credits"
    error_429:
      description: "429 — one of: rate_limit_exceeded (RPM limit exceeded); tpm_limit_exceeded (TPM limit exceeded)"
      headers:
        x-nemo-request-id:
          description: "Unique request ID"
          schema:
            type: "string"
        x-nemo-request-cost:
          description: "Exact cost in USD"
          schema:
            type: "number"
        x-nemo-guardrails-applied:
          description: "Guardrails that ran on this request"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-prompt-version:
          description: "Prompt template version injected"
          schema:
            type: "integer"
        x-nemo-ab-test:
          description: "A/B test variant selected"
          schema:
            type: "string"
        x-nemo-post-call-guardrails:
          description: "Post-call guardrails that ran"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-stream-buffered:
          description: "Stream buffered for guardrails"
          schema:
            type: "boolean"
        x-nemo-cache:
          description: "Cache hit/miss (models endpoint)"
          schema:
            type: "string"
        x-nemo-latency-ms:
          description: "Server-side latency in milliseconds"
          schema:
            type: "number"
      content:
        "application/json":
          schema:
            type: "object"
            properties:
              error:
                type: "object"
                properties:
                  type:
                    type: "string"
                    enum:
                      - "rate_limit_exceeded"
                      - "tpm_limit_exceeded"
                    example: "rate_limit_exceeded"
                  message:
                    type: "string"
                    example: "RPM limit exceeded"
    error_503:
      description: "503 — Credit system unavailable"
      headers:
        x-nemo-request-id:
          description: "Unique request ID"
          schema:
            type: "string"
        x-nemo-request-cost:
          description: "Exact cost in USD"
          schema:
            type: "number"
        x-nemo-guardrails-applied:
          description: "Guardrails that ran on this request"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-prompt-version:
          description: "Prompt template version injected"
          schema:
            type: "integer"
        x-nemo-ab-test:
          description: "A/B test variant selected"
          schema:
            type: "string"
        x-nemo-post-call-guardrails:
          description: "Post-call guardrails that ran"
          schema:
            type: "string"
            description: "Comma-separated values."
        x-nemo-stream-buffered:
          description: "Stream buffered for guardrails"
          schema:
            type: "boolean"
        x-nemo-cache:
          description: "Cache hit/miss (models endpoint)"
          schema:
            type: "string"
        x-nemo-latency-ms:
          description: "Server-side latency in milliseconds"
          schema:
            type: "number"
      content:
        "application/json":
          schema:
            type: "object"
            properties:
              error:
                type: "object"
                properties:
                  type:
                    type: "string"
                    enum:
                      - "credit_check_failed"
                    example: "credit_check_failed"
                  message:
                    type: "string"
                    example: "Credit system unavailable"
