Text generation
Chat completions
Send chat completion requests to any model through Inworld Inference, and find the guide for each capability: tool calling, structured outputs, streaming, vision, and reasoning.
Use /v1/chat/completions to generate text on Inworld Inference. Send requests in OpenAI's chat completions format to any model the router serves. The router translates each request for the provider that handles it.
Choose a model
Browse inworld.ai/models and select Text to compare chat models, model IDs, pricing and context limits. Check the capabilities your request needs, such as image input, tool calling, structured outputs or reasoning; support varies by model.
For programmatic discovery, use the authenticated List models API. Its response includes spec.inputModalities, spec.outputModalities, spec.supportedParameters and spec.capabilities. Use provider/model as the request identifier; for Inworld-hosted models listed as models/<name>, use inworld/models/<name>.
Send a request
curl --request POST \
--url https://api.inworld.ai/v1/chat/completions \
--header "Authorization: Basic $INWORLD_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "auto",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a 50-word bio for a software engineer."}
]
}'import os
from openai import OpenAI
api_key = os.environ["INWORLD_API_KEY"]
client = OpenAI(
base_url="https://api.inworld.ai/v1",
api_key=api_key,
default_headers={"Authorization": f"Basic {api_key}"},
)
response = client.chat.completions.create(
model="auto",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a 50-word bio for a software engineer."},
],
)
print(response.choices[0].message.content)model can be auto, a specific model such as openai/gpt-5, or a router you have configured. See Request-level routing for choosing models and fallbacks on a single request.
Capabilities
Each capability has its own guide:
Tool calling
Let the model call functions you define, on any provider.
Structured outputs
Get JSON that follows your schema.
Streaming
Receive the response as it is generated.
Image and audio inputs
Send images and audio alongside text.
Reasoning
Control how much the model reasons before it answers.
Web search
Ground answers in current web results.
Prompt caching
Reduce cost and latency on repeated context.
Voice responses
Generate an answer and speak it with Inworld TTS. See the Voice guide.
Other request formats
- Responses API accepts OpenAI's Responses format.
- Anthropic compatibility accepts Anthropic's Messages format.
- OpenAI compatibility covers using the OpenAI SDKs.
See the API reference for every parameter.