Skip to main content
Glama

openai_chat_completion

Create chat completions with OpenAI models. Send a conversation and receive AI-generated text or structured JSON responses.

Instructions

Create a chat completion using OpenAI models via AceDataCloud.

Sends a conversation to the specified model and returns the generated response.
Supports all major GPT and o-series models.

Use this when:
- You need to have a conversation with an AI model
- You want to generate text responses based on a prompt
- You need structured JSON output from a model

Returns:
    JSON response containing the model's reply and usage information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoHow many chat completion choices to generate for each input. Default is 1.
modelNoThe model to use for chat completion. Options include gpt-4.1, gpt-4o, gpt-5, o1, o3, o4-mini, and many more. Default is gpt-4.1.gpt-4.1
messagesYesA list of messages comprising the conversation. Each message must have a 'role' ('system', 'user', or 'assistant') and 'content' field. Example: [{'role': 'user', 'content': 'Hello!'}]
max_tokensNoThe maximum number of tokens to generate. If not specified, the model uses its default limit.
temperatureNoSampling temperature between 0 and 2. Higher values (e.g. 0.8) make output more random, lower values (e.g. 0.2) make it more focused. Default is 1.
service_tierNoSpecifies the processing tier. Options: 'auto' (default), 'default', 'flex', 'scale', 'priority'.
reasoning_effortNoConstrains effort on reasoning for reasoning models. Options: 'minimal', 'low', 'medium', 'high'. Default is 'medium'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains that the tool sends a conversation to a model and returns a JSON response with the reply and usage information. This adequately covers the main behavior without contradictions.

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 concise, using a few sentences and bullet points. Every sentence adds value: purpose, supported models, use cases, and return format. No wasted words.

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

Completeness4/5

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

Given the output schema exists, the description does not need to detail return values extensively. It mentions the JSON response includes reply and usage information, which is sufficient. Parameters are fully described in the schema. Could be more complete with error handling, but adequate.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. The description adds minimal extra meaning beyond the schema, e.g., mentioning 'all major GPT and o-series models' and the return format. It does not significantly enhance parameter understanding.

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 the tool creates a chat completion using OpenAI models. It specifies the verb 'create' and the resource 'chat completion.' The sibling tools like openai_create_embedding and openai_generate_image are distinct, so this description effectively differentiates itself.

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 includes a 'Use this when:' section listing three specific scenarios: conversation, text generation, and structured JSON output. It does not explicitly mention when not to use or alternative tools, but the use cases are clear and distinct from siblings.

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/AceDataCloud/OpenAIMCP'

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