In this article
Check which component appends the operation path; a correct base URL cannot repair a mismatched request protocol.
For an OpenAI-compatible OpenRouter client, the usual base URL is https://openrouter.ai/api/v1. The correct field value still depends on the tool: some expect a base address, while others require a complete endpoint. Check the client’s contract and inspect the final HTTP address instead of repeatedly changing credentials.
Separate base and operation paths
| Configuration field | Expected form |
|---|---|
| SDK base URL that appends methods | https://openrouter.ai/api/v1 |
| Direct Chat Completions request | The base followed by /chat/completions |
| Direct Responses request | The base followed by /responses |
A client that already adds an operation suffix can produce a duplicated path if given the full endpoint. Conversely, sending a direct POST to the base alone does not identify the intended operation. Record the final method and URL, with credentials excluded, as part of the working configuration.
Find the component adding the suffix
Trace the request from the application to any gateway and then to OpenRouter. A browser-facing backend may expose its own local route and forward to a different external address. Its configuration should make the distinction explicit so that a user does not replace the local route with an external credential-bearing call.
When an SDK or plugin changes, compare the actual outgoing path before and after the change. A working historical setting is useful evidence, but not proof that another library expects the same field. Check for duplicate /api/v1 segments and missing operation names rather than guessing from a settings label.
Match the body to the selected API
A valid address cannot repair an incompatible payload. Chat Completions and Responses have their own request structures. Use the parameters documented for the chosen operation instead of renaming one field while retaining an object from another protocol.
Start with one synchronous text request, a checked model identifier and a small output limit. Once it works, add streaming or tools independently. This keeps protocol errors distinguishable from event-parser issues or unsupported model features. A model catalog label may also differ from an application’s friendly display name.
Verify gateways and preserve the result
If a gateway is involved, repeat the controlled request at the authorized direct boundary and through the intended application route. Different results point to an intermediate configuration or error transformation. Record HTTP status and safe error fields; do not attach the Authorization header to a shared report.
Save the client version, base address, selected operation and model ID together. Retest after changing the SDK or gateway. This gives a GPU owner or technical partner a clear integration boundary without confusing an address problem with missing compute.
Official references: openrouter.ai — authentication, openrouter.ai — overview.
Related guides: Setting up an OpenRouter API key for an application, OpenRouter error 404: API address, model ID or route.