Create chat completion
create_chat_completionGenerate chat completions with OpenAI-compatible models, supporting text, multimodal content, and inline images with automatic MIME type correction.
Instructions
Create an OpenAI-compatible chat completion. For inline image_url data URLs, declare the byte-accurate image MIME type. The MCP boundary corrects recognized PNG, JPEG, WebP, and GIF payloads declared as application/octet-stream and rejects unrecognized generic binary image payloads before sending a billable request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of completions to generate | |
| seed | No | Seed for deterministic generation | |
| stop | No | Stop sequences | |
| user | No | End-user identifier for abuse detection | |
| audio | No | Audio output configuration when requesting audio modality. | |
| model | Yes | ID of the model to use (e.g., gpt-5.4, claude-sonnet-4-6) | |
| tools | No | List of tools the model may call | |
| top_p | No | Nucleus sampling probability | |
| logprobs | No | Whether to return log probabilities for output tokens. | |
| messages | Yes | A list of messages comprising the conversation | |
| functions | No | Deprecated function definitions retained by the official Chat Completions contract. | |
| logit_bias | No | Per-token logit bias map. | |
| max_tokens | No | Maximum number of tokens to generate | |
| modalities | No | Requested output modalities such as text or audio. | |
| prediction | No | Prediction hints for providers that support draft or speculative decoding. | |
| temperature | No | Sampling temperature (0-2) | |
| tool_choice | No | Controls which function is called | |
| service_tier | No | Service tier hint for compatible providers. | |
| top_logprobs | No | Number of most likely tokens to return at each position when logprobs is enabled. | |
| function_call | No | Deprecated function-call selection retained by the official Chat Completions contract. | |
| stream_options | No | Streaming options such as usage chunk inclusion. | |
| response_format | No | Response format specification | |
| presence_penalty | No | Presence penalty (-2 to 2) | |
| reasoning_effort | No | Reasoning effort hint for compatible model families. | |
| frequency_penalty | No | Frequency penalty (-2 to 2) | |
| parallel_tool_calls | No | Whether the model may issue parallel tool calls. | |
| translation_options | No | Language settings for models that translate audio or video through Chat Completions. | |
| max_completion_tokens | No | Maximum completion tokens for newer reasoning-enabled model families |