Code librariesReviewed · OpenRouter

OpenRouter Client SDKs (TypeScript, Python, Go)

OpenRouter Client SDKs are thin, type-safe client libraries in TypeScript, Python and Go for developers who want to call many AI models through OpenRouter's API and handle their own conversation loops; the main catch is that they only mirror the REST API, so tool dispatch, state and agent logic are left to you. They are auto-generated from OpenRouter's OpenAPI spec and cover completions, streaming, embeddings, video, rerank and account key and credit management, according to the overview page.

Researched 13 Nov 2026

In short.

OpenRouter's Client SDKs are lean, type-safe libraries for TypeScript, Python and Go, aimed at developers who want direct calls to many AI models through one API and are happy to manage orchestration themselves; the main catch is that they are only a thin wrapper over the REST API, so conversation state, tool execution and agent loops are your job, and the page says nothing about licence, pricing or version. The overview page says they handle authentication, request validation and response typing, are generated from the OpenRouter OpenAPI spec, and give access to 400+ models. The page also shows install commands for npm, pnpm, yarn, bun, deno, pip and go get, plus a TypeScript and a Python example that call client.responses.send with the model openai/gpt-5.2. Nothing was run, so all behaviour described here is what the documentation claims.

Researched and written by an AI model and checked by a second AI model. How it works

The reviewed scope is the single documentation page at [https://openrouter.ai/docs/client-sdks/overview.md], captured in full on 13 November 2026. Linked pages (the TypeScript, Python and Go SDK references, the Agent SDK overview and the npm, PyPI and Go package pages) were not read and are excluded. No SDK code, licence file, release notes or pricing were reviewed, and nothing was installed or executed, so all behaviour described is the documentation's claim and is untested.

The overview

What this resource is

This is the Client SDKs overview page in the OpenRouter documentation. It describes three client libraries for the OpenRouter API: a TypeScript package named @openrouter/sdk on npm, a Python package named openrouter on PyPI, and a Go module published as github.com/OpenRouterTeam/go-sdk.

The page presents them as a thin, type-safe layer over the OpenRouter REST API. Per the page, the layer handles authentication, request validation and response typing so one function call can reach any of the 400+ models OpenRouter lists. The 400+ figure is the vendor's own claim on this page.

The page is an overview. It points to separate TypeScript, Python and Go reference pages and to an Agent SDK overview, but those pages are not part of the evidence reviewed here.

Overall assessment

On the evidence, this is a clearly described, focused set of libraries with a sensible scope. The page is explicit about what they are for (direct model inference where you own the application logic) and what they are not for (built-in agent loops, which it assigns to the separate Agent SDK).

The assessment is limited to a single documentation page. No source code, package contents, licence, changelog, issue tracker or test results were available, so quality of the implementation, error handling, retry behaviour and long-term maintenance are not assessed. A reader should treat this report as a description of what the vendor says the SDKs do, not as verification.

Who it is for

The page targets developers who want direct, efficient access to model inference and want to manage their own application logic. It lists single-turn completions, streaming, embeddings, video and rerank, programmatic API key and credit management, and custom orchestration where you handle conversation loops, tool dispatch and state yourself.

It suits developers working in TypeScript, Python or Go. Beginners should be comfortable with installing a package, keeping an API key in an environment variable and reading a typed response object; the TypeScript example uses top-level await and a few type checks on the response, so some familiarity with async code helps.

It is a poor fit for people who want a ready-made agent framework with multi-turn loops, automatic tool execution and managed conversation state. The page says to use the Agent SDK for that, and notes the Agent SDK is available in TypeScript only.

What it can do

According to the page, the Client SDKs cover single-turn completions, streaming token-by-token responses, embeddings, video generation, reranking, and account management for API keys and credits. They mirror the OpenRouter API surface 1:1 with full type safety.

The page says all three SDKs are auto-generated from the OpenRouter OpenAPI spec, so new models, parameters and endpoints appear immediately after each API release. That is a vendor claim about timing; it was not checked. A practical consequence of generation from a spec is that the SDK surface should track the REST API closely, but the page does not describe hand-written helpers beyond this.

Not shown on this page: streaming code, embeddings code, video or rerank code, key management code, or any Go code beyond the go get command. Whether every capability is available in every language is not stated.

Using it

Requirements

The examples pass an apiKey read from the OPENROUTER_API_KEY environment variable, so an OpenRouter API key is required to make calls. The page does not explain how to obtain a key or whether an account or credit balance is needed before a first call. The mention of credit management suggests a credit system exists, but its rules are not described here.

You need a package manager for your language: npm, pnpm, yarn, bun or deno for TypeScript, pip for Python, or the Go toolchain. Minimum Node.js, Python or Go versions, supported runtimes and dependency requirements are not stated on the page and are unknown.

Network access to the OpenRouter API is implied because the SDKs wrap its REST endpoints.

How it works

The SDKs are thin clients generated from the OpenRouter OpenAPI spec. You create a client object with your API key, then call methods that correspond to REST endpoints. The page names the client class OpenRouter in both the TypeScript and Python examples and shows a responses.send method.

The client validates requests and types responses, per the page. In the TypeScript example the arguments are wrapped in a responsesRequest object, while the Python example passes model and input as keyword arguments, so the two languages follow their own conventions. The response can be a streaming or a non-streaming shape; the TypeScript example checks that an output field exists before reading it.

Transport details such as HTTP library, timeouts, retries, rate-limit handling and error classes are not described on this page and are unknown.

Setup

Install with one of these commands from the page: npm install @openrouter/sdk, pnpm add @openrouter/sdk, yarn add @openrouter/sdk, bun add @openrouter/sdk, deno add npm:@openrouter/sdk, pip install openrouter, or go get github.com/OpenRouterTeam/go-sdk.

Then set the OPENROUTER_API_KEY environment variable and construct the client with that key. The package pages named on the overview are [https://www.npmjs.com/package/@openrouter/sdk], [https://pypi.org/project/openrouter/] and [https://pkg.go.dev/github.com/OpenRouterTeam/go-sdk].

Go client construction is not shown on this page. Configuration options such as base URL, headers or timeouts are not covered and are unknown.

Worked example from the page

The TypeScript quick example imports OpenRouter from @openrouter/sdk and creates a client with the API key from the environment. It calls client.responses.send with a responsesRequest containing the model openai/gpt-5.2 and the input text 'Explain quantum computing in one sentence.'.

It then guards the result: it throws if the response has no output field (meaning it was not a non-streaming response), throws if the status is not 'completed' (using the error message when present), and finally finds the last item of type 'message' in the output and prints the text of its first 'output_text' part.

The Python example does the same inside a with block that opens and closes the client, passing model and input directly, raising a RuntimeError if the status is not 'completed', and printing the output_text of the last message item. This is a reading of the documented code; it was not executed here, and whether the model name is currently available is unknown.

Assessment & evidence

Limitations and risks

By design the SDKs are lean: you manage conversation state, dispatch tool calls and write your own loops. The page's own comparison table says so. If you need those features you must build them or switch to the Agent SDK, which is TypeScript only, so Python and Go users have no equivalent named on this page.

Claims such as 400+ models, no provider-specific quirks and new endpoints appearing immediately after each API release are vendor statements that were not verified. Using the SDKs ties your code to OpenRouter's API and to its availability and pricing, a dependency the page does not discuss.

The example requires manual narrowing of the response type (checking for an output field, then status, then searching the output array for a message item), which suggests the response shape is a union that callers must handle carefully. Streaming usage, pagination, error types and retry behaviour are not documented on this page. Nothing was executed, so behaviour, performance and compatibility are all untested.

Reasoning

The documented install commands for npm, pnpm, yarn, bun, deno, pip and go get, along with the matching TypeScript and Python quick examples, give a concrete starting point for direct OpenRouter API integration: create an OpenRouter client with an API key, call responses.send with a model and an input, check the response status and read the output text.

The trade-off is that the Client SDKs stop at the API layer. Callers must build conversation loops, tool dispatch and state management themselves; the page's comparison table gives those jobs to the Agent SDK instead. That makes the Client SDKs a reasonable fit when you want fine-grained control over calls, and a weaker fit when you want built-in agent behaviour, especially in Python or Go, because the page lists the Agent SDK as TypeScript only.

The page does show some error handling. In both quick examples the caller checks whether the response status is 'completed' and raises an error if it is not, using the response's error message when one is present. The TypeScript example also throws if the response has no output field, which means it was not a non-streaming response. What the page does not describe is the SDKs' own error classes, retry behaviour or rate-limit handling, so those remain unknown, as do licence, version, cost, runtime requirements and Go usage beyond installation.

Alternatives and related options

The page names one alternative: the OpenRouter Agent SDK, for building agents with multi-turn loops, tool definitions, stop conditions and conversation state. It uses callModel and a tool() helper, and is TypeScript only according to the comparison table.

Because the Client SDKs are a layer over a REST API, calling the REST API directly with an HTTP client is a logical option, but this page does not document that path, so it was not assessed. Other vendors' SDKs and third-party libraries are not compared on the page and were not assessed.

Evidence used

The only evidence is the captured text of the Client SDKs overview page at [https://openrouter.ai/docs/client-sdks/overview.md]. It includes the package table, install commands, the claim of generation from the OpenAPI spec, the use-case list, the TypeScript and Python quick examples and the Client SDKs versus Agent SDK table. The scope is limited to that single page; linked pages are excluded.

No source repository, package metadata, release notes or independent reviews were available. Nothing was installed or executed, so all behaviour described is what the documentation claims and is untested.

Access & freshness

Costs

The page states no price for the SDKs themselves and no price for model calls. It lists API key and credit management as something the SDKs can do, but it does not explain what credits are or how they are charged.

SDK installation costs, API usage prices, billing arrangements, free tiers and minimum top-ups are unknown from this page. Check OpenRouter's own pricing information before relying on the service.

Rights and licence

The page does not state a licence for the SDK packages, nor terms for using the OpenRouter service or the models behind it. The licence of each package is unknown from this evidence and would have to be read from the npm, PyPI or Go repository pages.

Model outputs may carry their own provider terms; this is not addressed on the page and was not assessed. No package files were captured, so nothing from the SDKs themselves is redistributed with this report.

Freshness

The page was captured on 13 November 2026. It shows no version number, release date or changelog, so the currently published SDK versions and how recently they were updated are unknown from this evidence.

The example uses the model name openai/gpt-5.2, and model availability on a router service can change, so the example may need a different model identifier later. The page's claim that SDKs track each API release means the documented surface may shift; check the language-specific reference pages for current signatures.

Suggested next steps

If you want direct typed access to many models and are fine writing your own loops, install the package for your language and try the quick example with your own API key stored in OPENROUTER_API_KEY, checking that the model identifier is currently available.

Before adopting it in a product, check the licence and release history on the npm, PyPI or Go package pages, review OpenRouter's pricing and terms, and read the language reference pages for streaming, error handling and Go usage. If you need built-in agent loops and tool execution in TypeScript, look at the Agent SDK overview at [https://openrouter.ai/docs/agent-sdk/overview.md] instead.

Evidence for this report

selected-page.txtselected · checked 2026-11-13