/v1/chat/completions endpoint is the primary interface for text-based workflows. It supports streaming, tool calling, and structured outputs across all providers.
Standard Request
Multimodal Inputs
To send images or audio alongside text, use the array form ofcontent with typed content blocks.
Images
Useimage_url with a base64 data URI or an HTTP URL. Google AI Studio and Vertex AI require base64 data URIs; other providers also accept HTTP URLs.
Audio
Useinput_audio with base64-encoded audio data:
Multimodal support depends on the underlying model. Refer to the provider’s documentation for supported input types, formats, and limits.
Advanced Features
Tool Calling (Function Calling)
Inworld Router normalizes tool calling. You define tools in the OpenAI format, and the router translates them for Anthropic or Google models.Structured Outputs (JSON Mode)
Force the model to return valid JSON by settingresponse_format: { "type": "json_object" }. Inworld Router ensures the underlying provider respects this constraint.
Streaming
Real-time token streaming is supported for all providers. The stream format is identical to OpenAI’s Server-Sent Events (SSE).Web search
See Web search forextra_body.web_search, web_search_options, and citation annotations.