OpenRouter Gateway

Create an OpenRouter chat completion

Changed on

Forward OpenRouter requests and return its response, status code, or event stream unchanged. OpenRouter fields such as provider and reasoning are preserved. Supply your Respan key in Authorization and your OpenRouter key in x-openrouter-api-key; this endpoint requires your own OpenRouter key and does not use Respan gateway credits.

post/api/openrouter/v1/chat/completions

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/openrouter/v1/chat/completions
  • Auth
    HTTP bearer

Headers

x-openrouter-api-keystring required

Your OpenRouter API key. Authorization carries the Respan API key on this operation.

Request body

modelstring required

OpenRouter model slug, for example openai/gpt-6-luna. An openrouter/ prefix is also accepted and is stripped before the call goes upstream.

messagesobject[] required
streamboolean
providerobject

OpenRouter provider routing block, forwarded unchanged.

reasoningobject

OpenRouter reasoning block, forwarded unchanged.

respan_paramsobject

Respan gateway metadata. Stripped before the payload reaches OpenRouter. Must be a JSON object: a string, list, number or boolean is ignored and none of its params apply.

Response

OpenRouter response or event stream.

object required

Changes

    • breaking

      request body became required

    • breaking

      the request property's minItems was increased to 1

    • info

      api operation id openRouterGateway_openrouter_native_chat_completions removed and replaced with openrouter_native_chat_completions

    • info

      api tag OpenRouter Gateway added

    • info

      api tag openRouterGateway removed

    • info

      added the media type text/event-stream for the response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status