Chat completions
Use /v1/chat/completions for a language model listed by your inference endpoint. Authenticate requests with a workspace API key. The job page also offers dedicated controls for a verified Mjolnir merchant adapter.
Test a trained Mjolnir merchant model
- Open Tuning jobs, choose your completed merchant job and select Chat.
- On a workspace with a resident model host, wait for Model ready. If the model is stopped, select Start model. Send a message, then a follow-up in the same conversation.
- Select Stop model to free the host. You can start it again from the saved adapter. The resident host keeps the model loaded between turns while it is running.
On a Kaggle-only workspace, each message queues a private inference job. You can return to the job page to see the completed reply. Choose Ticket routing when you want the ticket’s predicted queue.
Basic request
import requests
resp = requests.post(
"https://ragnarok-ai.com/api/v1/chat/completions",
headers={"Authorization": "Bearer sk-ft-…"},
json={
"model": "ft:a1b2c3…", # or "Qwen/Qwen2.5-0.5B-Instruct"
"messages": [{"role": "user", "content": "Summarize our refund policy."}],
},
).json()
print(resp["choices"][0]["message"]["content"])Use GET /v1/models with your workspace key to find the IDs available for this endpoint. Use the job-specific chat controls above for a Mjolnir merchant job.
Streaming
Set "stream": true to receive server-sent events with incremental deltas, terminated by data: [DONE] — the standard chat SSE wire format.
JSON mode
{ "response_format": {"type": "json_object"}, … }The response is guaranteed to be a single parseable JSON object.
Function calling
{
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}}
}
}],
…
}When the model elects to call a tool, the choice arrives with finish_reason: "tool_calls" and structured arguments — execute the function and send the result back as a tool role message.
Pricing
Per-token prices are derived from GPU cost per second and measured throughput for the model's size tier — see GET /v1/pricing for the live table. Requests are charged against prepaid credits; the worker pool scales to zero between requests.