Chat Completions
Send a multi-turn conversation to a chat model and receive an assistant message. This is the primary endpoint for LLMs and is fully compatible with the OpenAI Chat Completions API.
/v1/chat/completionsRequest body
1{
2 "model": "pkrd/cosmosrp-3.5",
3 "messages": [
4 { "role": "system", "content": "You are a helpful assistant." },
5 { "role": "user", "content": "Hello!" }
6 ],
7 "temperature": 0.7,
8 "max_tokens": 1024,
9 "stream": false
10}Parameters
modelmessagesstreamtemperaturetop_ptop_kmin_pmax_tokensfrequency_penaltypresence_penaltyrepetition_penaltystopseednlogprobstoolstool_choiceresponse_formatreasoning_effortuserMessage roles
systemSets behavior, persona and constraints. Usually first.
userInput from the end-user.
assistantPrevious model replies, for multi-turn context.
toolResult of a tool call, paired with the original tool_call_id.
Vision input
Models with the vision capability accept image parts in user messages. Pass an HTTPS URL or a data: base64 URL.
1{
2 "model": "pkrd/cosmosrp-3.5",
3 "messages": [
4 {
5 "role": "user",
6 "content": [
7 { "type": "text", "text": "What is in this image?" },
8 {
9 "type": "image_url",
10 "image_url": { "url": "https://example.com/cat.jpg" }
11 }
12 ]
13 }
14 ]
15}Tool / function calling
Models with the toolCalling capability can choose to call a tool you declare. The model returns tool_calls in the assistant message; you execute the tool and feed the result back as a tool message.
1{
2 "model": "openai/gpt-oss-20b",
3 "messages": [
4 { "role": "user", "content": "What is the weather in Paris?" }
5 ],
6 "tools": [
7 {
8 "type": "function",
9 "function": {
10 "name": "get_weather",
11 "description": "Get current weather for a city",
12 "parameters": {
13 "type": "object",
14 "properties": {
15 "city": { "type": "string" }
16 },
17 "required": ["city"]
18 }
19 }
20 }
21 ],
22 "tool_choice": "auto"
23}Reasoning
Models with thinking support a reasoning_effort parameter. The hidden chain-of-thought may be exposed via reasoning field on the response message.
1{
2 "model": "pkrd/cosmosrp-3.5:msr",
3 "messages": [
4 { "role": "user", "content": "Solve: if 3x + 5 = 20, what is x?" }
5 ],
6 "reasoning_effort": "medium"
7}Streaming
Set stream: true to receive Server-Sent Events. See the Response Format page for chunk structure.
1curl https://api.pawan.krd/v1/chat/completions \
2 -H "Authorization: Bearer pk-your_key" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "pkrd/cosmosrp-3.5",
6 "messages": [{ "role": "user", "content": "Tell me a story" }],
7 "stream": true
8 }'Per-model parameter ranges