Chat Completions
OpenAI-compatible chat completions.
POST https://api.solcardinference.ai/v1/chat/completionsRequest and response follow the OpenAI Chat Completions format. Only the fields below are accepted; others are ignored.
| Field | Type | Notes |
|---|---|---|
model |
string |
Required. A model ID. |
messages |
array |
Required. system, user, assistant and tool messages. Content is a string or an array of text parts. |
stream |
boolean |
Stream as server-sent events. See streaming. |
stream_options |
object |
{ "include_usage": true } adds a final usage chunk. |
max_completion_tokens |
integer |
Output token limit, up to 32,768. max_tokens is accepted as an alias. |
temperature |
number |
|
top_p |
number |
|
stop |
string | array |
|
presence_penalty |
number |
|
frequency_penalty |
number |
|
seed |
integer |
|
logit_bias |
object |
|
logprobs |
boolean |
|
top_logprobs |
integer |
|
response_format |
object |
{ "type": "json_object" } or { "type": "json_schema", "json_schema": {...} }. |
tools |
array |
Function tools. See tool calling. |
tool_choice |
string | object |
|
parallel_tool_calls |
boolean |
|
reasoning_effort |
string |
Default none. See reasoning. |
web_search_options |
object |
{ "search_context_size": "low" | "medium" | "high" }. See web search. |
n |
integer |
Default 1. Only 1 is supported. |
user |
string |
Not supported: image, audio and file content (400 unsupported_content), n above 1 and best_of (400 unsupported_parameter).
Example request
Section titled “Example request”curl https://api.solcardinference.ai/v1/chat/completions \ -H "Authorization: Bearer $SOLCARD_INFERENCE_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "flash", "messages": [{ "role": "user", "content": "Hi" }] }'Example response
Section titled “Example response”{ "id": "chatcmpl-...", "object": "chat.completion", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help?" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 9, "completion_tokens": 7, "total_tokens": 16 }}