chat completion
chat_completionUse this when you need an answer from a frontier AI model without an account or an API key: Claude (Opus, Fable, Sonnet, Haiku), GPT-6 or Grok, one call. OpenAI-style messages in, an OpenAI chat.completion out (choices, usage). The price is quoted before the call from your input and max_tokens at the model rate, plus a small margin; a failed call is not charged. Text only, no tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | the model (default haiku-4-5) | |
| quote | No | true: return the price of this call without running or paying for it | |
| messages | Yes | the conversation, OpenAI style, text only, the last message from the user (50 messages, 24,000 characters at most) | |
| max_tokens | No | the most the answer may use, reasoning included (default 1024); the price is computed from it |