Chat completions

POST /v1/chat/completions, shaped like OpenAI’s. /v1/completions and /v1/responses exist for the same models; /v1/responses is stateless by design.

Request

curl https://api.openmayhem.ai/v1/chat/completions \
  -H "Authorization: Bearer $OPENMAYHEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "hauhaucs/qwen3.6-35b-a3b-uncensored",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 2000,
    "temperature": 0.7
  }'

Or with the OpenAI SDK, changing only the base URL and key:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.openmayhem.ai/v1",
  apiKey: process.env.OPENMAYHEM_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "hauhaucs/qwen3.6-35b-a3b-uncensored",
  messages: [{ role: "user", content: "Hello" }],
  max_tokens: 2000,
});

Parameters

Everything you send beyond the required fields passes through to the network, which validates it against the model’s signed contract. An unsupported attribute is rejected with a 400 before any provider runs, so it costs nothing. Each model’s catalog page lists its supported parameters, for example qwen3.6 accepts tools, response_format, temperature, seed and more.

Reasoning models think before they answer, and thinking consumes max_tokens. Budget 2000 tokens or more; a too-small budget returns an empty reply with finish_reason "length", billed for the thinking that did happen.

Idempotency

Send an Idempotency-Key header to make retries safe: the same key returns the original request’s result instead of running and billing twice.