Build OpenRouter API requests with this interactive tool. Select a model, configure messages, parameters, and provider preferences, then generate code in your preferred language.
Select one or more models. Additional models will be used as fallbacks.
When enabled, the API will return a stream of tokens as they are generated.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "If you built the world'\''s tallest skyscraper, what would you name it?"
}
]
}'