Skip to content
Sign in Create account

POST demo/chat-completions

POST /api/v1/demo/chat-completions

Accepts a prompt accompanied by the client pre-tokenization markers through the authenticated demo chat and returns the model response. The gateway checks the request markers and MAC; it does not verify that tokenization ran.

Authenticate with an API key.

Request body

application/json object

  • message string
    Length: at most 8000 characters
  • messages array of object
    Items: 1 to 60 items

    Each item:

    • content string required
    • role string required
      One of: "user", "assistant", "system"
  • model string
    Length: at most 64 characters

Generated sample

{
  "message": "string",
  "messages": [
    {
      "content": "string",
      "role": "user"
    }
  ],
  "model": "string"
}

Responses

200 Successful response.

application/json object

Any keys are accepted.

401 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

403 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

413 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

415 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

422 The request failed validation.

application/json object

Any keys are accepted.

428 The required pretokenized request marker is missing.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 The route throttle limit was exceeded.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string

502 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

503 The demo configuration, provider pricing, or usage limits are unavailable.

Response headers

  • Retry-After string header

    Retry delay in seconds.

application/json any

One of

  • object
    • error object required
      • message string required
      • code string required
        Value: "demo_rate_limit_unavailable"
      • type string required
        Value: "service_unavailable"
  • object
    • error string required
    • code string required
      Value: "demo_unconfigured"