---
title: "Create an OpenRouter chat completion"
method: POST
path: "/api/openrouter/v1/chat/completions"
tags: ["openRouterGateway"]
---

# Create an OpenRouter chat completion

`POST /api/openrouter/v1/chat/completions`

Relay an OpenRouter chat-completions payload through Respan with nothing filtered out, so OpenRouter-owned fields such as provider and reasoning survive the call. This endpoint is BYOK: Authorization carries your Respan API key and x-openrouter-api-key carries your OpenRouter API key. There is no fallback to Respan gateway credits. OpenRouter's response, status code, and event stream are relayed back unchanged.

## Headers

- `Authorization` string, required
- `x-openrouter-api-key` string, required

## Request body

- object
  - `model` string, required — OpenRouter model slug, for example anthropic/claude-sonnet-4-5. An openrouter/ prefix is also accepted and is stripped before the call goes upstream.
  - `messages` object[], required
  - `stream` boolean
  - `provider` object — OpenRouter provider routing block, forwarded unchanged.
  - `reasoning` object — OpenRouter reasoning block, forwarded unchanged.
  - `respan_params` object — Respan gateway metadata. Stripped before the payload reaches OpenRouter.

## Response `200`

OpenRouter response or event stream.

- object

## Other responses

- `400` — Invalid request, or the x-openrouter-api-key header is missing.
- `401` — Invalid Respan API key.
- `402` — Relayed from OpenRouter: insufficient credits.
- `404` — Relayed from OpenRouter: unknown model or route.
- `429` — Rate limit exceeded, from Respan or relayed from OpenRouter.

## Changes

- **2026-08-28** `c61efaf24756` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/openrouter/v1/chat/completions/post.md)

---

[API](https://skmtc.dev/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.dev/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/c61efaf24756/schema)
