{
  "openapi": "3.1.0",
  "info": {
    "title": "Outrun API",
    "version": "2026-10-29",
    "summary": "One prepaid key for OpenAI-, Anthropic- and Gemini-compatible requests.",
    "description": "Outrun is a prepaid AI API. One key (sk-rs-...) works for every endpoint and every model, billed per use from a USD balance. This description covers the endpoints documented at https://outrun.to/docs/api. Model IDs and prices: https://api.outrun.to/pricing. Base URLs: OpenAI-compatible https://api.outrun.to/v1; Anthropic SDKs use the bare host https://api.outrun.to and add /v1/messages themselves; Gemini native uses https://api.outrun.to/v1/gemini-cli.",
    "contact": {
      "name": "Outrun support",
      "url": "https://t.me/outrunsupport"
    }
  },
  "externalDocs": {
    "description": "API reference",
    "url": "https://outrun.to/docs/api"
  },
  "servers": [
    {
      "url": "https://api.outrun.to/v1",
      "description": "OpenAI-compatible base URL"
    }
  ],
  "tags": [
    {
      "name": "Text"
    },
    {
      "name": "Images"
    },
    {
      "name": "Audio"
    },
    {
      "name": "Video"
    },
    {
      "name": "Account"
    },
    {
      "name": "Pricing"
    }
  ],
  "paths": {
    "/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Chat Completions",
        "description": "OpenAI Chat Completions. Add \"stream\": true to stream. Works for all text models, and for image models as chat-to-image. Speech to text: send the audio as an input_audio content part to gemini-3-stt.",
        "tags": [
          "Text"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "max_tokens": {
                    "type": "integer"
                  },
                  "temperature": {
                    "type": "number"
                  }
                },
                "required": [
                  "model",
                  "messages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/responses": {
      "post": {
        "operationId": "createResponse",
        "summary": "Responses",
        "description": "OpenAI Responses API (used by Codex). GPT models.",
        "tags": [
          "Text"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    ]
                  },
                  "reasoning": {
                    "type": "object",
                    "properties": {
                      "effort": {
                        "type": "string"
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "model",
                  "input"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "output": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/messages": {
      "post": {
        "operationId": "createMessage",
        "summary": "Anthropic Messages",
        "description": "Anthropic Messages API (used by Claude Code). Claude models. Full URL: https://api.outrun.to/v1/messages; Anthropic SDKs take the bare host https://api.outrun.to as their base URL.",
        "tags": [
          "Text"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "max_tokens": {
                    "type": "integer"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "model",
                  "max_tokens",
                  "messages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "usage": {
                      "type": "object"
                    }
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "anthropicKey": []
          }
        ],
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "2023-06-01"
              ]
            }
          }
        ]
      }
    },
    "/messages/count_tokens": {
      "post": {
        "operationId": "countMessageTokens",
        "summary": "Count tokens",
        "description": "Anthropic token counting. Claude models.",
        "tags": [
          "Text"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  }
                },
                "required": [
                  "model",
                  "messages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "input_tokens": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "anthropicKey": []
          }
        ],
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "2023-06-01"
              ]
            }
          }
        ]
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models",
        "description": "The model IDs available to your key.",
        "tags": [
          "Text"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/images/generations": {
      "post": {
        "operationId": "createImage",
        "summary": "Generate an image",
        "description": "Image models return one image per request. Billed per image.",
        "tags": [
          "Images"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "size": {
                    "type": "string",
                    "examples": [
                      "16:9"
                    ]
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "b64_json": {
                            "type": "string",
                            "description": "Base64-encoded PNG"
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/audio/speech": {
      "post": {
        "operationId": "createSpeech",
        "summary": "Text to speech",
        "description": "Use a preset voice name (for example Kore on Gemini TTS models, eve on grok-tts) and a supported response_format (wav, mp3, flac or pcm on Gemini; mp3, wav, pcm, mulaw or alaw on grok-tts). Returns the audio bytes.",
        "tags": [
          "Audio"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "input": {
                    "type": "string"
                  },
                  "voice": {
                    "type": "string",
                    "examples": [
                      "Kore"
                    ]
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "wav",
                      "pcm"
                    ]
                  }
                },
                "required": [
                  "model",
                  "input"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/videos": {
      "post": {
        "operationId": "createVideo",
        "summary": "Start a video task",
        "description": "Returns a task id with status \"queued\". Billed per second of output; allowed lengths depend on the model (see the API reference).",
        "tags": [
          "Video"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID, case-sensitive. List them with GET /models or https://api.outrun.to/pricing.",
                    "examples": [
                      "gpt-5.6-sol"
                    ]
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "seconds": {
                    "type": "integer"
                  },
                  "size": {
                    "type": "string",
                    "examples": [
                      "16:9"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "examples": [
                      "4k"
                    ]
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTask"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/videos/{id}": {
      "get": {
        "operationId": "getVideo",
        "summary": "Check a video task",
        "description": "Poll every few seconds until status is \"completed\" or \"failed\".",
        "tags": [
          "Video"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTask"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/videos/{id}/content": {
      "get": {
        "operationId": "getVideoContent",
        "summary": "Download a finished video",
        "description": "Returns the mp4.",
        "tags": [
          "Video"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/gemini-cli/v1beta/models/{model}:generateContent": {
      "post": {
        "operationId": "generateContent",
        "summary": "Gemini generateContent",
        "description": "Gemini native generation. Gemini models. Use this exact path: plain /v1beta/... on the host is blocked.",
        "tags": [
          "Text"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contents": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "required": [
                  "contents"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "candidates": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "usageMetadata": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "googleKey": []
          }
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "gemini-3.8-flash"
              ]
            }
          }
        ]
      }
    },
    "/gemini-cli/v1beta/models/{model}:streamGenerateContent": {
      "post": {
        "operationId": "streamGenerateContent",
        "summary": "Gemini streamGenerateContent",
        "description": "Gemini native streaming. Add ?alt=sse for server-sent events.",
        "tags": [
          "Text"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contents": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "required": [
                  "contents"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "googleKey": []
          }
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "gemini-3.8-flash"
              ]
            }
          },
          {
            "name": "alt",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sse"
              ]
            }
          }
        ]
      }
    },
    "/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Check your credit",
        "description": "Your Outrun Credit balance in USD.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "examples": [
                        "USD"
                      ]
                    },
                    "credit": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Public price list",
        "description": "Every model ID with its billed prices, as JSON. No key needed. Served from https://api.outrun.to/pricing.",
        "tags": [
          "Pricing"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "401": {
            "description": "Missing, mistyped or replaced key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; wait a moment and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The model is temporarily paused, or a temporary server error; try another model or retry after a short wait",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "servers": [
          {
            "url": "https://api.outrun.to",
            "description": "Bare host"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer $OUTRUN_API_KEY (all OpenAI-style /v1 endpoints)."
      },
      "anthropicKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "x-api-key: $OUTRUN_API_KEY, plus the anthropic-version header (Anthropic-style requests)."
      },
      "googleKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-goog-api-key",
        "description": "x-goog-api-key: $OUTRUN_API_KEY; the key can also go in the ?key= query parameter (Gemini native requests)."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": [
              "object",
              "string"
            ]
          }
        },
        "description": "The usual OpenAI / Anthropic JSON error shape."
      },
      "ChatCompletion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system",
                        "user",
                        "assistant",
                        "tool"
                      ]
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                },
                "finish_reason": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "completion_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "VideoTask": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed"
            ]
          }
        }
      },
      "PriceList": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "generated_at": {
            "type": "integer",
            "description": "Unix time"
          },
          "paused": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Model IDs that are paused and not billable right now"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "family": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "unit": {
                  "type": "string"
                },
                "tiers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "unit": {
                        "type": "string"
                      },
                      "prices": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "id",
                "kind",
                "tiers"
              ]
            }
          }
        },
        "required": [
          "currency",
          "models"
        ]
      }
    }
  }
}
