यह पृष्ठ अभी तक हिन्दी में अनूदित नहीं है। अंग्रेज़ी मूल दिखाया जा रहा है।
Request parameters
What we accept, what we ignore, what we reject
The body parameters of POST /chat/completions and POST /completions fall into three groups.
- Consumed by the gateway — we read them and do not forward them upstream. The routing parameters live here.
- Overwritten by us — whatever you send, our value wins.
- Passed through untouched — everything else, including sampling parameters and tool definitions.
Knowing which group a parameter is in is how you answer "why did this parameter have no effect?" for yourself.
1. Parameters the gateway consumes
modelstringThe model id to call, for example google/gemma-4-26b-a4b. Omit it and the service default model is used. An unknown id is 400 model_not_found.
modelsstring[]A candidate chain. We try them in order and stop at the candidate that starts responding. A non-empty array takes precedence over model.
Unknown ids inside the array are dropped silently — the array means "whichever of these works". Only if every id is unknown do you get 400 model_not_found. A single model behaves differently: an unknown id is 400 immediately.
The full rules are in Model fallbacks.
providerobjectProvider selection rules, applied in this order.
| Field | Type | Effect |
|---|---|---|
order | string[] | Reorders the chain by provider slug. Candidates not named go to the back |
only | string[] | Keeps only those slugs |
ignore | string[] | Removes those slugs |
sort | "price" | "throughput" | "latency" | Sell price ascending / throughput descending / latency ascending |
allow_fallbacks | boolean | false truncates the chain to its first candidate |
max_price | {prompt?, completion?} | A ceiling in USD per token. We multiply by the current FX rate and compare against our KRW sell price |
require_parameters | boolean | true keeps only candidates that support every parameter present in your body |
data_collection | "allow" | "deny" | Applied only to candidates whose metadata we know |
zdr | boolean | Same |
quantizations | string[] | Filters candidates whose quantization is known |
If filtering leaves no candidates, the result is 404 no_endpoints_found. Candidates whose metadata we do not know pass the filter — otherwise a missing metadata field would silently delete the whole local chain. See Provider routing.
routestringWe accept "fallback". openrouter deprecated the value, and it behaves exactly like the default, but we take it without raising 400 so existing code does not need editing.
transformsstring[]Accepted and ignored. We do not implement message transforms. It does not error, so openrouter code keeps running; the fact that nothing happens is documented here.
pluginsobject[]Accepted and ignored. We do not implement plugins such as PDF parsing.
promptstring | string[]/completions only. A string array is joined with \n into a single messages:[{role:"user"}]. Sent to /chat/completions it is simply discarded.
2. Parameters we overwrite
messagesobject[]आवश्यकRequired on /chat/completions. Not an array, or an empty array, is 400 invalid_request. Every entry must carry a string role, or it is 400 as well. content is not validated — it goes upstream as given.
streambooleanDefaults to false. Only true produces an SSE response, and it must be the boolean true — the string "true" is treated as non-streaming.
stream_optionsobjectYour value is discarded; on a streaming request we always set {"include_usage": true}. Without it the upstream sends no usage, and then there is nothing to attach the cost to on the final chunk (see Streaming).
3. Parameters passed straight through
Every field not in the two groups above is forwarded to the upstream untouched. There is no allowlist, so a parameter your model understands works even if we have never heard of it.
| Parameter | Type | Conventional default |
|---|---|---|
max_tokens | integer | model default |
temperature | float, 0.0–2.0 | 1.0 |
top_p | float, 0.0–1.0 | 1.0 |
top_k | integer, ≥ 0 | 0 (off) |
frequency_penalty | float, −2.0–2.0 | 0.0 |
presence_penalty | float, −2.0–2.0 | 0.0 |
repetition_penalty | float, 0.0–2.0 | 1.0 |
seed | integer | none |
stop | string or string[] | none |
logit_bias | {[token_id]: -100…100} | none |
response_format | object | none |
tools, tool_choice | object[] / string or object | none |
Checking what a model supports
Each model's supported_parameters is in the GET /models response, and it also works as a filter.
curl "https://openrouter.myip.co.kr/api/v1/models?supported_parameters=tools"Our local GPU models report:
| Model | supported_parameters |
|---|---|
google/gemma-4-26b-a4b | max_tokens, temperature, top_p, top_k, stop, seed, frequency_penalty, presence_penalty, repetition_penalty, logit_bias, response_format, tools, tool_choice |
lgai/exaone-4.0-32b | The same list without tools and tool_choice |
Sending a parameter that is not on a model's list is not blocked by us; the upstream either ignores it or errors. To have it filtered for you, use provider.require_parameters: true.
A full example
curl https://openrouter.myip.co.kr/api/v1/chat/completions \
-H "Authorization: Bearer $MYIP_API_KEY" \
-H "Content-Type: application/json" \
-H "HTTP-Referer: https://myapp.example" \
-H "X-Title: My App" \
-d '{
"models": ["google/gemma-4-26b-a4b", "lgai/exaone-4.0-32b"],
"provider": { "sort": "price", "allow_fallbacks": true },
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain the TCP three-way handshake in three sentences."}
],
"max_tokens": 300,
"temperature": 0.3,
"top_p": 0.9,
"seed": 42,
"stop": ["\n\nEND"]
}'Errors caused by parameters
| Status | error_type | When |
|---|---|---|
| 400 | invalid_request | Body is not a JSON object; messages missing or empty; a message without role; /completions prompt that is neither a string nor a string array |
| 400 | model_not_found | model is an unknown id, or every id in models[] is unknown |
| 404 | no_endpoints_found | The provider filter removed every candidate |
The rest are in Errors and debugging.
अंतिम अद्यतन 5 सित॰ 2026