Quickstart
This page takes you from a new account to your first paid request in a few minutes.
Set up
- Create an account and add credit on the credit page. Credit is spent per request.
- Create an API key under API keys. The secret is shown once and never again.
- Pick a model id from the live catalog, which shows prices and how many providers are online right now.
Make a request
POST /v1/chat/completionsCHAT ยท openai_chat_completions +
Working request
curl https://api.openmayhem.ai/v1/chat/completions \
-H "Authorization: Bearer $OPENMAYHEM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"model": "qwen/qwen3.8-27b",
"max_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh",
"thinking_mode": "enabled"
}'Parameters
| Parameter | Required | Type | Default | Allowed values | Limits and shape |
|---|---|---|---|---|---|
messages | Required | array | โ | โ | min items 1; max items 4096 [{"role":"user","content":"Hello"}] |
model | Required | string | โ | Qwen/Qwen3.8-27B | โ |
frequency_penalty | Optional | number | โ | โ | min -2; max 2 |
max_completion_tokens | Optional | integer | โ | โ | min 0; max 262144 |
max_tokens | Optional | integer | โ | โ | min 0; max 262144 |
metadata | Optional | object | โ | โ | JSON object; use the endpoint-specific schema shown in the examples |
min_p | Optional | number | โ | โ | min 0; max 1 |
presence_penalty | Optional | number | โ | โ | min -2; max 2 |
reasoning_effort | Optional | string | xhigh | low, medium, xhigh | โ |
response_format | Optional | object | โ | โ | {"type":"json_object"} |
seed | Optional | integer | โ | โ | min 0; max 4294967295 |
stop | Optional | string | array | null | โ | โ | JSON array |
stream | Optional | boolean | false | โ | โ |
temperature | Optional | number | โ | โ | min 0; max 2 |
thinking_history | Optional | string | preserve | latest_only, preserve | โ |
thinking_mode | Optional | string | enabled | disabled, enabled | โ |
tool_choice | Optional | string | object | โ | โ | "auto" or an OpenAI tool-choice object |
tools | Optional | array | โ | โ | min items 1; max items 128 [{"type":"function","function":{"name":"get_time","description":"Get the current time","parameters":{"type":"object","properties":{}}}}] |
top_k | Optional | integer | โ | โ | min 0; max 1000000 |
top_p | Optional | number | โ | โ | min 0.000001; max 1 |
user | Optional | string | โ | โ | min length 1; max length 512 |
Input shapes
{
"model": "qwen/qwen3.8-27b",
"tools": [
{
"type": "function",
"function": {
"name": "get_time",
"description": "Get the current time",
"parameters": {
"type": "object",
"properties": {}
}
}
}
]
}POST /v1/completionsCOMPLETIONS ยท openai_completions +
Working request
curl https://api.openmayhem.ai/v1/completions \
-H "Authorization: Bearer $OPENMAYHEM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "qwen/qwen3.8-27b",
"prompt": "A lighthouse at dusk",
"max_tokens": 2000,
"stream": false
}'Parameters
| Parameter | Required | Type | Default | Allowed values | Limits and shape |
|---|---|---|---|---|---|
model | Required | string | โ | Qwen/Qwen3.8-27B | โ |
prompt | Required | string | โ | โ | min length 1; max length 32000 |
frequency_penalty | Optional | number | โ | โ | min -2; max 2 |
max_tokens | Optional | integer | โ | โ | min 0; max 262144 |
min_p | Optional | number | โ | โ | min 0; max 1 |
presence_penalty | Optional | number | โ | โ | min -2; max 2 |
reasoning_effort | Optional | string | xhigh | low, medium, xhigh | โ |
seed | Optional | integer | โ | โ | min 0; max 4294967295 |
stop | Optional | string | array | null | โ | โ | JSON array |
stream | Optional | boolean | false | โ | โ |
temperature | Optional | number | โ | โ | min 0; max 2 |
thinking_history | Optional | string | preserve | latest_only, preserve | โ |
thinking_mode | Optional | string | enabled | disabled, enabled | โ |
top_k | Optional | integer | โ | โ | min 0; max 1000000 |
top_p | Optional | number | โ | โ | min 0.000001; max 1 |
user | Optional | string | โ | โ | min length 1; max length 512 |
POST /v1/responsesRESPONSES ยท openai_responses +
Working request
curl https://api.openmayhem.ai/v1/responses \
-H "Authorization: Bearer $OPENMAYHEM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "qwen/qwen3.8-27b",
"input": "Hello",
"max_output_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh"
}'Parameters
| Parameter | Required | Type | Default | Allowed values | Limits and shape |
|---|---|---|---|---|---|
input | Required | string | array | โ | โ | JSON array |
model | Required | string | โ | Qwen/Qwen3.8-27B | โ |
max_output_tokens | Optional | integer | โ | โ | min 0; max 262144 |
metadata | Optional | object | โ | โ | JSON object; use the endpoint-specific schema shown in the examples |
min_p | Optional | number | โ | โ | min 0; max 1 |
reasoning_effort | Optional | string | xhigh | low, medium, xhigh | โ |
stream | Optional | boolean | false | โ | โ |
temperature | Optional | number | โ | โ | min 0; max 2 |
text | Optional | object | โ | โ | JSON object; use the endpoint-specific schema shown in the examples |
thinking_history | Optional | string | preserve | latest_only, preserve | โ |
thinking_mode | Optional | string | enabled | disabled, enabled | โ |
tool_choice | Optional | string | object | โ | โ | "auto" or an OpenAI tool-choice object |
tools | Optional | array | โ | โ | min items 1; max items 128 [{"type":"function","function":{"name":"get_time","description":"Get the current time","parameters":{"type":"object","properties":{}}}}] |
top_k | Optional | integer | โ | โ | min 0; max 1000000 |
top_p | Optional | number | โ | โ | min 0.000001; max 1 |
user | Optional | string | โ | โ | min length 1; max length 512 |
Input shapes
{
"model": "qwen/qwen3.8-27b",
"tools": [
{
"type": "function",
"function": {
"name": "get_time",
"description": "Get the current time",
"parameters": {
"type": "object",
"properties": {}
}
}
}
]
}POST /v1/chat/completionsCHAT ยท hf_multimodal_chat +
Working request
curl https://api.openmayhem.ai/v1/chat/completions \
-H "Authorization: Bearer $OPENMAYHEM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"model": "qwen/qwen3.8-27b",
"max_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh",
"thinking_mode": "enabled"
}'Parameters
| Parameter | Required | Type | Default | Allowed values | Limits and shape |
|---|---|---|---|---|---|
messages | Required | array | โ | โ | min items 1; max items 4096 [{"role":"user","content":"Hello"}] |
model | Required | string | โ | Qwen/Qwen3.8-27B | โ |
max_tokens | Optional | integer | โ | โ | min 0; max 262144 |
min_p | Optional | number | โ | โ | min 0; max 1 |
reasoning_effort | Optional | string | xhigh | low, medium, xhigh | โ |
response_format | Optional | object | โ | โ | {"type":"json_object"} |
seed | Optional | integer | โ | โ | min 0; max 4294967295 |
stream | Optional | boolean | false | โ | โ |
temperature | Optional | number | โ | โ | min 0; max 2 |
thinking_history | Optional | string | preserve | latest_only, preserve | โ |
thinking_mode | Optional | string | enabled | disabled, enabled | โ |
tool_choice | Optional | string | object | โ | โ | "auto" or an OpenAI tool-choice object |
tools | Optional | array | โ | โ | min items 1; max items 128 [{"type":"function","function":{"name":"get_time","description":"Get the current time","parameters":{"type":"object","properties":{}}}}] |
top_k | Optional | integer | โ | โ | min 0; max 1000000 |
top_p | Optional | number | โ | โ | min 0.000001; max 1 |
Input shapes
{
"model": "qwen/qwen3.8-27b",
"tools": [
{
"type": "function",
"function": {
"name": "get_time",
"description": "Get the current time",
"parameters": {
"type": "object",
"properties": {}
}
}
}
]
}Use this model through MCP
These calls use this modelโs exact live request contract. First estimate the unchanged request, then pass the returned estimate ID and maximum cost to the paid tool. Read the complete MCP guide.
chatCHAT +
Send this object to estimate_request. Review the result, then send the next object to the named paid tool without changing request.
{
"endpoint": "CHAT",
"model": "qwen/qwen3.8-27b",
"request": {
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh",
"thinking_mode": "enabled"
}
}{
"model": "qwen/qwen3.8-27b",
"request": {
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh",
"thinking_mode": "enabled"
},
"estimate_id": "<estimate_id from estimate_request>",
"max_cost_usd": "<maximum_cost_usd from estimate_request>"
}create_responseRESPONSES +
Send this object to estimate_request. Review the result, then send the next object to the named paid tool without changing request.
{
"endpoint": "RESPONSES",
"model": "qwen/qwen3.8-27b",
"request": {
"input": "Hello",
"max_output_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh"
}
}{
"model": "qwen/qwen3.8-27b",
"request": {
"input": "Hello",
"max_output_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh"
},
"estimate_id": "<estimate_id from estimate_request>",
"max_cost_usd": "<maximum_cost_usd from estimate_request>"
}chatCHAT +
Send this object to estimate_request. Review the result, then send the next object to the named paid tool without changing request.
{
"endpoint": "CHAT",
"model": "qwen/qwen3.8-27b",
"request": {
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh",
"thinking_mode": "enabled"
}
}{
"model": "qwen/qwen3.8-27b",
"request": {
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 2000,
"stream": false,
"reasoning_effort": "xhigh",
"thinking_mode": "enabled"
},
"estimate_id": "<estimate_id from estimate_request>",
"max_cost_usd": "<maximum_cost_usd from estimate_request>"
}Agent drop-ins
These configurations make this exact model the main model in each harness. Create an API key first and keep it in OPENMAYHEM_API_KEY.
OpenCode+
Save this as opencode.json in your project, export the key, then select openmayhem/model in /models.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openmayhem": {
"npm": "@ai-sdk/openai-compatible",
"name": "OpenMayhem",
"options": {
"baseURL": "https://api.openmayhem.ai/v1",
"apiKey": "{env:OPENMAYHEM_API_KEY}"
},
"models": {
"qwen/qwen3.8-27b": {
"name": "Qwen3.8 27B",
"limit": {
"context": 262144,
"output": 32768
}
}
}
}
}
}export OPENMAYHEM_API_KEY="replace-with-your-openmayhem-api-key"
opencode --model "openmayhem/qwen/qwen3.8-27b"Claude Code+
Claude Code speaks Anthropic Messages. Claude Code Router 2.0.0 translates it to this model's Chat Completions endpoint and removes Claude-only cache metadata.
{
"LOG": false,
"API_TIMEOUT_MS": 3600000,
"Providers": [
{
"name": "openmayhem",
"api_base_url": "https://api.openmayhem.ai/v1/chat/completions",
"api_key": "$OPENMAYHEM_API_KEY",
"models": [
"qwen/qwen3.8-27b"
],
"transformer": {
"use": [
"cleancache"
]
}
}
],
"Router": {
"default": "openmayhem,qwen/qwen3.8-27b",
"background": "openmayhem,qwen/qwen3.8-27b",
"think": "openmayhem,qwen/qwen3.8-27b",
"longContext": "openmayhem,qwen/qwen3.8-27b",
"longContextThreshold": 229376
}
}npm install -g @anthropic-ai/claude-code @musistudio/claude-code-router@2.0.0
export OPENMAYHEM_API_KEY="replace-with-your-openmayhem-api-key"
export MAX_THINKING_TOKENS=0
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=262144
export CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1
ccr start &
ccr code
ccr stopCodex CLI+
Codex 0.80.0 is the tested Chat Completions compatibility release for this model. The key stays in the environment; config.toml contains no secret.
model = "qwen/qwen3.8-27b"
model_provider = "openmayhem"
model_context_window = 262144
[model_providers.openmayhem]
name = "OpenMayhem"
base_url = "https://api.openmayhem.ai/v1"
env_key = "OPENMAYHEM_API_KEY"
wire_api = "chat"
request_max_retries = 4
stream_max_retries = 5
stream_idle_timeout_ms = 3600000export OPENMAYHEM_API_KEY="replace-with-your-openmayhem-api-key"
npx -y @openai/codex@0.80.0Hermes Agent+
Hermes uses OpenMayhem as a named custom provider over Chat Completions. The key stays in OPENMAYHEM_API_KEY and is not stored in YAML.
providers:
openmayhem:
api: "https://api.openmayhem.ai/v1"
key_env: OPENMAYHEM_API_KEY
transport: chat_completions
default_model: "qwen/qwen3.8-27b"
models:
"qwen/qwen3.8-27b":
context_length: 262144
model:
default: "qwen/qwen3.8-27b"
provider: custom:openmayhem
api_mode: chat_completions
context_length: 262144
max_tokens: 32768curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
export OPENMAYHEM_API_KEY="replace-with-your-openmayhem-api-key"
hermes chatOpenClaw+
Merge this provider into openclaw.json. apiKey is an environment SecretRef, so the resolved key is not written to the file.
{
"models": {
"mode": "merge",
"providers": {
"openmayhem": {
"baseUrl": "https://api.openmayhem.ai/v1",
"apiKey": "${OPENMAYHEM_API_KEY}",
"api": "openai-completions",
"authHeader": true,
"timeoutSeconds": 3600,
"models": [
{
"id": "qwen/qwen3.8-27b",
"name": "Qwen3.8 27B",
"reasoning": true,
"input": [
"text"
],
"contextWindow": 262144,
"contextTokens": 229376,
"maxTokens": 32768,
"compat": {
"supportsTools": true,
"supportsReasoningEffort": true,
"supportedReasoningEfforts": [
"low",
"medium",
"xhigh"
],
"supportsTemperature": true
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openmayhem/qwen/qwen3.8-27b"
}
}
}
}export OPENMAYHEM_API_KEY="replace-with-your-openmayhem-api-key"
openclaw agent --local --model "openmayhem/qwen/qwen3.8-27b" --message "Hello"The response is OpenAI-shaped, with two additions: the exact cost in USD inside usage, and the identity of the signed receipt the charge settled against.
Details for expertsresponse (abridged)
{
"choices": [{ "message": { "role": "assistant", "content": "โฆ" } }],
"usage": {
"prompt_tokens": 8, "completion_tokens": 62, "total_tokens": 70,
"cost": "0.000023"
},
"openmayhem": {
"request_id": "โฆ",
"receipt": { "session_id": "โฆ", "sequence": 1, "final": true, "verified": true }
}
}