GPT family
OpenAI’s GPT text models, including the GPT-6, GPT-5.x, GPT-4o and Codex series. They are called through the OpenAI-compatible API, which supports both Chat Completions and Responses; the official OpenAI SDK works once you change base_url.
Common tasks
Models
Check each model’s input modalities and supported parameters before choosing it. For the full model list and live prices, see the model page , or query the Models API.
openai/gpt-6.2-astraopenai/gpt-6.2-solopenai/gpt-6-solopenai/gpt-5.4openai/gpt-5.4-miniYou can omit the openai/ prefix, e.g. gpt-5.4. The model field in responses always includes the prefix.
Choosing an endpoint
supported_endpoints in the Models API for other models.For the full request parameters, see the Chat Completions API and the Responses API.
Providers
GPT-6.2 Astra and Sol are served by Azure AI Foundry on /v1/chat/completions and /v1/responses. Use Responses for function calling or web search. Check the model details before selecting a provider. To select a provider, add the X-OfoxAI-Provider-Type: azure_foundry request header; for other methods, see Provider routing.
Examples
Python (Chat Completions)
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"])
resp = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[
{"role": "system", "content": "You are a senior backend engineer. Keep answers concise."},
{"role": "user", "content": "Explain idempotency in one sentence."},
],
)
print(resp.choices[0].message.content)Prompt caching
When a request’s prefix matches a recent request and is long enough, it hits the cache automatically, and the cached portion is billed at the cache read rate.
For general information on caching, see Prompt caching.
Web search
Add web_search to tools on the Responses API, and the model runs searches on its own and cites sources. Chat Completions does not support web search.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"])
resp = client.responses.create(
model="openai/gpt-5.4",
tools=[{"type": "web_search"}],
input="What is the latest stable version of Python?",
)
print(resp.output_text)
print("Searches:", sum(1 for item in resp.output if item.type == "web_search_call"))Each web_search_call item in output is one search, and the message item is the final answer. Searches are billed per use; see the model page for the rate.
Common errors
For other general errors, see Error Handling.
Official docs
- OpenAI · Models overview
- OpenAI · Reasoning models
- OpenAI · Responses vs. Chat Completions
- OpenAI · Prompt caching
- OpenAI · Web search
The official docs describe behavior when calling OpenAI directly. When calling through OfoxAI, model IDs and endpoints on this page take precedence.
FAQ
How do I write a GPT model ID?
The standard format is openai/gpt-5.4. You can also omit the openai/ prefix and write gpt-5.4.
Should I use Chat Completions or Responses?
Either works. The Codex series and GPT-5.4 Pro support only Responses, and you also need Responses for reasoning summaries or web search. Projects with existing Chat Completions code can keep using it.
How do I enable reasoning for GPT?
In Chat Completions, pass reasoning_effort (e.g. "high"); in Responses, pass reasoning: {"effort": "high"}. Some models do not reason by default, so pass it explicitly when you need it.
Why is the GPT response empty with finish_reason length?
Reasoning tokens count toward max_completion_tokens, and once reasoning uses up the budget no answer is produced. Increase max_completion_tokens or lower reasoning_effort.
What does the error does not support the /v1/chat/completions endpoint mean?
The model supports only the Responses API, e.g. gpt-5.4-pro and gpt-5.3-codex. Use POST /v1/responses instead.
Can I see the GPT reasoning process?
Use the Responses API and pass reasoning: {"effort": "medium", "summary": "auto"}; the reasoning items in output will contain a reasoning summary. Chat Completions does not return reasoning content.
Can GPT search the web?
Yes. Use the Responses API and add {"type": "web_search"} to tools. Chat Completions does not support web search.
Do I need to enable GPT prompt caching manually?
No. When the prefix is long enough and matches a recent request, it hits the cache automatically; the cached amount is in cached_tokens in usage.
What should I do if GPT requests time out or return 504?
High-effort reasoning can take a long time. Use streaming (stream: true), set the client timeout to 600 seconds or more, or lower reasoning_effort.