Skip to main content
Glama

Create chat completion

create_chat_completion

Generate 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

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of completions to generate
seedNoSeed for deterministic generation
stopNoStop sequences
userNoEnd-user identifier for abuse detection
audioNoAudio output configuration when requesting audio modality.
modelYesID of the model to use (e.g., gpt-5.4, claude-sonnet-4-6)
toolsNoList of tools the model may call
top_pNoNucleus sampling probability
logprobsNoWhether to return log probabilities for output tokens.
messagesYesA list of messages comprising the conversation
functionsNoDeprecated function definitions retained by the official Chat Completions contract.
logit_biasNoPer-token logit bias map.
max_tokensNoMaximum number of tokens to generate
modalitiesNoRequested output modalities such as text or audio.
predictionNoPrediction hints for providers that support draft or speculative decoding.
temperatureNoSampling temperature (0-2)
tool_choiceNoControls which function is called
service_tierNoService tier hint for compatible providers.
top_logprobsNoNumber of most likely tokens to return at each position when logprobs is enabled.
function_callNoDeprecated function-call selection retained by the official Chat Completions contract.
stream_optionsNoStreaming options such as usage chunk inclusion.
response_formatNoResponse format specification
presence_penaltyNoPresence penalty (-2 to 2)
reasoning_effortNoReasoning effort hint for compatible model families.
frequency_penaltyNoFrequency penalty (-2 to 2)
parallel_tool_callsNoWhether the model may issue parallel tool calls.
translation_optionsNoLanguage settings for models that translate audio or video through Chat Completions.
max_completion_tokensNoMaximum completion tokens for newer reasoning-enabled model families
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint=false, destructiveHint=false), the description reveals that the MCP boundary corrects recognized image payloads and rejects unrecognized generic binary before billing, adding valuable behavioral insight not captured in annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences with front-loaded purpose and no redundant information. Every sentence contributes essential guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the tool is complex (28 parameters, nested objects, no output schema), the description focuses narrowly on image handling. It lacks guidance on streaming, error handling, or expected return values, leaving gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description adds value by specifying inline image handling for the messages parameter, a critical detail beyond the schema's generic descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Create an OpenAI-compatible chat completion' with a specific verb and resource. It also provides precise handling instructions for image data URLs, distinguishing it from sibling tools like 'create_anthropic_message' or 'create_gemini_content'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for when to use this tool (chat completions with OpenAI-compatible models) and specific guidance on image MIME types. However, it does not explicitly state when not to use it or mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hedging8563/tokenlab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server