API Reference

Documentation

Everything you need to integrate Pawan.Krd into your application.

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.

POST/v1/chat/completions

Request body

📋Request
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

model
stringrequired
Model ID. Optional if the model is in the URL path.
messages
arrayrequired
Conversation history. Each item has role and content.
stream
boolean
If true, response is sent as SSE chunks. Default: false.
temperature
number
Sampling temperature. Range and default depend on the model.
top_p
number
Nucleus sampling probability mass.
top_k
integer
Top-K sampling (when supported).
min_p
number
Minimum probability cutoff (when supported).
max_tokens
integer
Maximum tokens to generate.
frequency_penalty
number
Penalize repeated tokens (-2 to 2).
presence_penalty
number
Penalize tokens already in the conversation (-2 to 2).
repetition_penalty
number
Alternative repetition control (1.0 = no penalty).
stop
string | array
Up to 4 stop sequences.
seed
integer
Deterministic sampling seed.
n
integer
Number of completions per request.
logprobs
boolean | integer
Return per-token log probabilities.
tools
array
List of tool/function definitions for tool-calling models.
tool_choice
string | object
"auto", "none", "required", or a forced tool selection.
response_format
object
{ type: "json_object" } to force JSON output.
reasoning_effort
string
"low" | "medium" | "high" for reasoning models.
user
string
End-user identifier passed through for analytics.

Message roles

system

Sets behavior, persona and constraints. Usually first.

user

Input from the end-user.

assistant

Previous model replies, for multi-turn context.

tool

Result 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.

📋Vision request
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.

📋Tools request
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.

📋Reasoning request
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.

💻Streaming curl
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

Each model publishes its own valid ranges for these parameters. Check the model on the Models page or via the List Models endpoint to discover supported values.