Chat
Create Chat Completion
OpenAI-compatible uncensored chat, with streaming.
Drop-in compatible with the OpenAI SDK: point baseURL at https://api.spicyapi.com/v1 and pass your SpicyAPI key. Billed on total tokens.
Authorizations
Authorizationstringheaderrequired
Bearer authentication header of the form Bearer <token>, where <token> is your SpicyAPI key (sk-spicy-…). Create one in the dashboard under API Keys.
Body
application/jsonmodelstringrequired
A chat model id, e.g. spicy-chat-1.
messagesMessage · object[]required
The conversation so far.
temperaturenumber
Sampling temperature, 0–2.
max_tokensinteger
Cap on generated tokens.
streamboolean
Stream back server-sent events. Usage arrives in the final chunk.
Response
200 — application/jsonSuccessful Response
idstringrequired
Completion id.
choicesChoice · object[]required
Generated replies.
usageobject
Token counts.
cost_usdnumberrequired
What this request cost, in US dollars, already debited from your balance.
Was this page helpful?
Create Chat Completion
cURL
curl --request POST \
--url https://api.spicyapi.com/v1/chat/completions \
--header 'Authorization: Bearer $SPICYAPI_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "spicy-chat-1",
"messages": [
{ "role": "user", "content": "Hey, how was your day?" }
],
"temperature": 0.9
}'200
JSON
{
"id": "chatcmpl_7b3f",
"object": "chat.completion",
"model": "spicy-chat-1",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "<string>" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 84, "total_tokens": 96 },
"cost_usd": 0.000055
}