API Reference

Documentation

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

Text Completions

Prompt-style completion endpoint for base / instruct text models. Use this when your model has type text; for conversational models, use Chat Completions instead.

POST/v1/completions

Request body

📋Request
1{ 2 "model": "your-text-model-id", 3 "prompt": "Once upon a time", 4 "max_tokens": 256, 5 "temperature": 0.8, 6 "stream": false 7}

Parameters

model
stringrequired
Text-completion model id (type: text).
prompt
string | arrayrequired
Prompt or array of prompts to complete.
max_tokens
integer
Maximum tokens to generate.
temperature
number
Sampling temperature.
top_p
number
Nucleus sampling probability mass.
frequency_penalty
number
Penalize repeated tokens (-2 to 2).
presence_penalty
number
Penalize tokens already present (-2 to 2).
stop
string | array
Up to 4 stop sequences.
stream
boolean
If true, response is sent as SSE chunks.
n
integer
Number of completions to generate.
seed
integer
Deterministic sampling seed.
logprobs
integer
Top-N token log probabilities to return.

Response

📋200 OK
1{ 2 "id": "cmpl-abc123", 3 "object": "text_completion", 4 "created": 1700000000, 5 "model": "your-text-model-id", 6 "choices": [ 7 { 8 "index": 0, 9 "text": ", in a kingdom far away...", 10 "finish_reason": "length" 11 } 12 ], 13 "usage": { "prompt_tokens": 4, "completion_tokens": 8, "total_tokens": 12 } 14}
ℹ

Streaming

Set stream: true to receive Server-Sent Events. Each chunk has choices[].text with the next piece of the completion, and a final data: [DONE] sentinel.