Guides
Chat completions
Our primary endpoint, assemble messages[], set model to a provider-scoped id (e.g. openai/gpt-4o), tune decoding, and optionally stream SSE.
POST
https://api.rodiumai.io/v1/chat/completionsWhen to use
- Assistants, copilots, and chat UIs that need multi-turn text.
- Coding agents that generate or refactor full files.
- Vision: describe or reason over images in the same request.
- Let rodiumai/smart pick a strong model when you do not want to hardcode one.
Recipes
Coding agent
Ask for a complete Express + JWT server (or any scaffold). Prefer models tagged coding, or model rodiumai/smart.
Note: Keep max_tokens high enough for full files; stream for UX.
Vision (image_url)
Pass a user message with content parts: text + image_url (data URL or HTTPS). Works on vision-capable catalogue models.
Note: Huge images increase prompt tokens — resize when possible.
Tools / function calling
Send tools + tool_choice like OpenAI. Round-trip tool results as role tool messages.
Note: On Anthropic upstream via chat, prefer stream:false for tool rounds.
OpenAI SDK mode + cURL
…Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Provider-scoped model id (e.g. openai/gpt-4o, anthropic/claude-3-5-sonnet). Use GET /v1/models or the Models page to list all ids. |
| messages | array | Required | Array of message objects with role and content fields |
| max_tokens | integer | Optional | Maximum tokens to generate. Defaults to model maximum. |
| temperature | number | Optional | Sampling temperature between 0 and 2. Higher = more random. |
| top_p | number | Optional | Nucleus sampling probability mass. Between 0 and 1. |
| stream | boolean | Optional | If true, stream partial deltas as Server-Sent Events. |
| stop | string | array | Optional | Sequences where the API will stop generating tokens. |
Sample JSON
……Endpoint reference: POST /v1/chat/completions · Anthropic Messages