Skip to content
Sign in Create account

MessagesRequest

object

  • attachments array of object

    Client-reviewed attachment text entries.

    Each item:

    • text string
  • clipboard string

    Optional client-reviewed clipboard text.

  • dimensions integer
    Range: at least 1
  • encoding_format string
    One of: "float", "base64"
  • frequency_penalty number
    Range: -2 to 2
  • max_completion_tokens integer
    Range: 1 to 200000
  • max_tokens integer
    Range: at least 1
  • messages array of object required

    Only allowlisted message keys are accepted. annotations, audio metadata, url_citation, and other unknown message keys are rejected with 422 because they may contain text the client has not reviewed. Content parts also reject unknown keys and unsupported types. This gateway input subset is not measured against the upstream provider.

    Each item:

    • attachments array of object

      Client-reviewed attachment text entries.

      Each item:

      • text string
    • cache_control object
      • ttl string
        One of: "5m", "1h"
      • type string required
        One of: "ephemeral"
    • content any required

      One of

      • string
      • array of any

        Each item:

        One of

        • object
        • object
        • object
        • object
    • metadata object

      messages[*].metadata is removed before the request is forwarded. Root metadata keys must match the key class [A-Za-z0-9_.-]{1,32} and are not tokenized. Root string values that match the string class [A-Za-z0-9_.:@+/-]{0,512} are forwarded unchanged, except e-mail-form identity values, which are removed. A key or string outside its class receives 422.

    • role string required
      One of: "system", "developer", "user", "assistant"
    • tool_call_id any
    • tool_calls any
  • metadata object

    messages[*].metadata is removed before the request is forwarded. Root metadata keys must match the key class [A-Za-z0-9_.-]{1,32} and are not tokenized. Root string values that match the string class [A-Za-z0-9_.:@+/-]{0,512} are forwarded unchanged, except e-mail-form identity values, which are removed. A key or string outside its class receives 422.

  • model string required
    Length: at most 64 characters. Pattern: ^(?!.*//)(?!.*(?:^|/)\.{1,2}(?:/|$))(?!.*\/$)[A-Za-z0-9][A-Za-z0-9._:/@~+-]{0,63}(?![\s\S]). Example: "claude-opus-4-6"
  • n integer
    Range: 1 to 128
  • preprompt string

    Optional client-reviewed prompt prefix.

  • presence_penalty number
    Range: -2 to 2
  • provider string

    Provider identifier used for routing. Other values receive 422; inactive or unavailable providers receive 403.

    One of: "openai", "anthropic", "google", "azure", "grok", "openrouter", "gemini", "deepseek", "perplexity", "mistral", "cohere", "groq", "together", "fireworks"
  • reasoning_effort string

    Reasoning effort hint.

    One of: "none", "minimal", "low", "medium", "high", "xhigh", "max"
  • seed integer
    Range: 0 to 2147483647
  • stop any

    Operator configuration, not user text. One string or up to four strings, each at most 32 characters.

    One of

    • string
    • array of string
  • stream boolean
    Default: false
  • system any

    One of

    • string
    • array of object

      Each item:

      • cache_control object
        • ttl string
          One of: "5m", "1h"
        • type string required
          One of: "ephemeral"
      • text string required
      • type string required
        One of: "text"
  • temperature number
    Range: 0 to 1
  • tool_choice any

    One of

    • string
    • object
      • function object required
        • name string required
      • type string required
        One of: "function"
  • tools array of object

    Each item:

  • top_p number
    Range: 0 to 1
  • user string

    Optional short identifier only. Arbitrary user strings are not supported yet and receive 422.

    Pattern: ^[A-Za-z0-9_.:-]{1,64}$