> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.panicly.lol/llms.txt.
> For full documentation content, see https://docs.panicly.lol/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.panicly.lol/_mcp/server.

# API reference overview

The API reference documents the public gateway shape that applications call with a Panicly project key.

This reference focuses on public provider-compatible gateway routes. Dashboard RPC routes, auth routes, billing routes, and chatbot routes are documented separately as internal surfaces because they are not the same API product.

## Public gateway routes

`POST /v1/chat/completions`

`POST /v1/responses`

`POST /v1/embeddings`

`GET /v1/models`

## Authentication

```bash
Authorization: Bearer pk_live_...
```

```bash
x-panicly-key: pk_live_...
```

### Schema (`response`)

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /v1/chat/completions:
    post:
      operationId: create-chat-completion
      summary: Create a chat completion
      description: >
        Sends an OpenAI-compatible chat completion request through Panicly.

        Panicly authenticates the project key, evaluates controls, records a
        decision, and then forwards approved traffic upstream.
      tags:
        - subpackage_gateway
      responses:
        '200':
          description: Provider response returned through Panicly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '401':
          description: Missing or invalid Panicly API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Workspace has no remaining included or credit-backed capacity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Panicly policy blocked the request before provider forwarding.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
servers:
  - url: https://panicly.vercel.app
  - url: http://localhost:3000
components:
  schemas:
    ChatCompletionRequestMessagesItemsRole:
      type: string
      enum:
        - system
        - user
        - assistant
        - tool
      title: ChatCompletionRequestMessagesItemsRole
    ChatCompletionRequestMessagesItems:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/ChatCompletionRequestMessagesItemsRole'
        content:
          type: string
      required:
        - role
        - content
      title: ChatCompletionRequestMessagesItems
    ChatCompletionRequest:
      type: object
      properties:
        model:
          type: string
          description: Provider model identifier.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionRequestMessagesItems'
        max_tokens:
          type: integer
          description: Maximum tokens requested from the provider.
        temperature:
          type: number
          format: double
      required:
        - model
        - messages
      title: ChatCompletionRequest
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
      title: ChatCompletionResponse
    ErrorResponseError:
      type: object
      properties:
        type:
          type: string
        reason:
          type: string
        message:
          type: string
      required:
        - type
        - message
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorResponseError'
      title: ErrorResponse

```