Learning resourcesReviewed · OpenRouter

OpenRouter Python SDK: Observability Destinations Reference

This OpenRouter Python SDK reference page is for Python developers who route model calls through OpenRouter and want to manage observability destinations, which are external services such as Langfuse that receive data about their AI model requests. The main catch is that every operation needs an OpenRouter management key. The page also does not cover installation, pricing or the full list of destination types. It documents five methods on open_router.observability (list, create, get, update and delete), with parameter tables, a Python example for each method and the error types each can return. Nothing here was run or tested.

Researched 15 Nov 2026

In short.

This OpenRouter Python SDK reference page is for Python developers who send LLM traffic through OpenRouter and want to manage observability destinations. A destination is an external service, such as Langfuse (the page's only example), that OpenRouter forwards generation data to. The main catch is that every call needs an OpenRouter management key. The page also does not cover installation, pricing, licence or most destination types. It documents five methods (list, create, delete, get, update) on open_router.observability, with parameter tables, Python snippets and error types for each. It also lists controls over what is forwarded: privacy mode, sampling rate, filter rules, API key allowlists, regions and optional cost, identity and request-context metadata. This analysis is based only on the captured page text. Nothing was executed, so none of the described behaviour has been tested.

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

The selected scope is the complete documentation page at [https://openrouter.ai/docs/client-sdks/python/sdks/observability/README.md], captured on 2026-11-15. Linked pages were excluded. These include the management API keys guide, the destination type and filter-rule models, the region input model, the retry configuration, the response and operation pages, and the documentation index at [https://openrouter.ai/docs/llms.txt]. The page carries no licence or notice text. No SDK code was installed, imported or run, and no OpenRouter API call was made, so all described behaviour, including every example, is untested. Installation, pricing, licence, SDK version, response shapes and destination types other than langfuse are unknown from this evidence.

The overview

What this resource is

This is one page of OpenRouter's documentation for its Python client SDK. It covers the observability module, which you reach in code as open_router.observability after creating an OpenRouter client. The page is titled Observability, with the description Observability endpoints. It lists five operations on observability destinations: list, create, delete, get and update.

Here a destination is a configured target that receives data about requests made through OpenRouter. The only concrete example is a Langfuse destination, whose config holds a base URL, a public key and a secret key. The page is API reference material, not a tutorial or a standalone tool. It was captured from [https://openrouter.ai/docs/client-sdks/python/sdks/observability/README.md] on 2026-11-15.

Overall assessment

As a reference page it is specific and usable. Each operation has a description, a Python snippet that looks runnable, a parameter table (types, required flags and examples), a response type and an error table. It states several rules that matter in practice: a management key is required, each type allows at most 5 destinations, delete is a soft delete, and a workspace-scoped key cannot reach other workspaces.

Its weakness is scope. It does not explain how to install the SDK or how to get a management key (that is on a linked page that was not captured). It also does not say which destination types exist beyond langfuse, what config other types need, what filter_rules look like, or what the responses contain. It says nothing about pricing, licence or version. Treat it as a good parameter lookup for people who already use OpenRouter, not as a complete guide. No behaviour was checked by running code.

Who it is for

It suits developers and platform engineers who already call models through OpenRouter, want generation data sent to an external observability service, and prefer to manage that routing from code. It assumes you are comfortable with Python, environment variables, API keys and paginated API responses.

It is less suitable for beginners without an OpenRouter account, because the page does not explain account setup or how to create a management key. It also covers only Python, so it will not help anyone looking for other SDK languages. The page does not say who in an organisation should hold a management key, so teams need to decide that themselves.

What it can do

The five operations are: list destinations, with offset and limit pagination (limit max 100) and an optional workspace_id; create a destination; get one by its UUID; update one, changing only the fields you supply; and delete one, which is a soft delete.

Create has three required parameters. Config is a provider-specific dictionary whose shape depends on the type and is checked server-side. Name is a human-readable label. Type is the destination type, and only stable types are accepted. The optional create settings are as follows. Enabled sets whether the destination is switched on immediately. Privacy_mode, when true, stops request and response bodies being forwarded, so only metadata is sent. Sampling_rate runs from 0.0001 to 1, where 1 means 100%. Api_key_hashes is an allowlist of OpenRouter API key hashes whose traffic is forwarded. Leaving it out or setting it to null means all keys. A supplied list must contain at least one hash, and every hash must belong to an API key in the destination's workspace, otherwise the call returns 400. Filter_rules is described as optional structured rules that control which events are forwarded, but its shape is on a linked page that was not captured. Regions sets the data regions the destination applies to. It accepts eu as an alias for europe, defaults to global when left out, and must not be empty. Workspace_id targets a workspace other than the default.

Update requires only the destination id. Type and workspace_id are not documented as update parameters. The optional update fields are name, config, enabled, privacy_mode, sampling_rate, filter_rules, regions and api_key_hashes, and any field you leave out keeps its current value. In config, masked values are ignored and unset fields stay as they are. For api_key_hashes, leaving the field out keeps the current allowlist, while null clears the filter so all keys apply. A hash the destination already lists is kept even if that key has since moved to another workspace. Regions can be changed but not cleared. The update table gives no description for filter_rules.

On both create and update, four broadcast flags control extra metadata. Broadcast_generation_cost adds cost and billing data. Broadcast_generation_identity and broadcast_generation_request_context add identity and request-context data. Broadcast_generation_cost_allocation is labelled Beta. It adds per-token-kind usage and cost, sent only when they reconcile with the billed cost.

Using it

What you need

The page says every operation requires a management key and links to a management API keys guide that was not captured. The examples read the key from the OPENROUTER_API_KEY environment variable, so for these calls that variable would need to hold a management key. The page does not say that an ordinary inference key is enough.

You also need the OpenRouter Python SDK, imported with from openrouter import OpenRouter. The page gives no install command, package version or supported Python versions, so those are unknown. Create requires a provider-specific config dictionary whose shape depends on the destination type and is checked server-side. The page's only example is a Langfuse destination, whose config supplies a baseUrl, a publicKey and a secretKey. What accounts and credentials other destination types need is unknown from this page.

The examples also pass three optional header-style parameters: http_referer, x_open_router_title and x_open_router_categories. The page says they identify your app for rankings, dashboard display and marketplace categories. They are marked optional, and the snippets fill them with placeholder values.

How it works

The SDK exposes each operation as a Python method that calls an OpenRouter management endpoint. Destinations belong to a workspace. For list and create only, a call applies by default to the authenticated entity's default workspace, or to the workspace of a workspace-scoped management key, and you can target another workspace with workspace_id (a query parameter on list and a body field on create). A workspace-scoped key that asks list or create for a different workspace gets a 403. Get, update and delete identify a destination by its id and do not document a workspace_id parameter. For those three, a workspace-scoped management key only reaches destinations in its own workspace, and any id outside that workspace returns 404.

The page implies that once a destination is created and enabled, OpenRouter forwards generation events to it, subject to the allowlist, sampling rate, filter rules, regions and privacy settings you chose. It does not describe the delivery protocol, timing, retries on the OpenRouter side, batching or failure handling, so those are unknown. Update is partial: fields you leave out keep their current value, masked values in config are ignored, setting api_key_hashes to null clears the filter, and regions cannot be cleared. List returns a pageable result, and the example keeps calling res.next() until it returns None.

List only shows destinations with stable release status, so destinations of other types are left out of its results. Create likewise accepts only stable destination types.

Setup

The page has no setup guide, but it implies this order. First, install the OpenRouter Python SDK (the page does not say how). Second, create a management key using the linked guide, which was not captured. Third, put the key in OPENROUTER_API_KEY. Fourth, open the client in a with block, as every snippet does. Fifth, call the observability methods.

For a first destination, the create snippet shows the shape of the call. For an existing setup, list and get let you see what is configured. The update snippet disables a destination and renames it in one call. The page describes no configuration file, command-line tool or dashboard steps, and it does not say whether destinations can also be managed through a web dashboard.

Worked example from the page

The create example opens the client with api_key read from the environment. It then calls open_router.observability.create with a config dictionary that sets baseUrl to [https://us.cloud.langfuse.com] and gives masked placeholders for publicKey and secretKey. It sets name to Production Langfuse and type_ to langfuse, sets all four broadcast flags to False, sets enabled to True and privacy_mode to False, and prints the response.

There is a small inconsistency on the page. The parameter table calls the argument type, but the Python snippet uses type_ with a trailing underscore. Check the real SDK signature before relying on either. The update example is shorter: it takes an id and sets enabled to False and name to Updated Langfuse. Delete and get take only an id. These snippets were not run for this analysis, and the page shows no sample responses.

Assessment & evidence

Limitations and risks

Coverage gaps: the page does not list destination types beyond the langfuse example, the config shape for other types, the filter_rules schema, the response shapes or rate limits. It also does not explain what the 409 conflict responses on create and update mean. The page links to separate reference pages that were not captured: the destination type model (components.CreateObservabilityDestinationRequestType), the filter rules model (components.ObservabilityFilterRulesConfigNullable), the region input model (components.ObservabilityDataRegionInput), the retry configuration (utils.RetryConfig), the five response models (operations.ListObservabilityDestinationsResponse, components.CreateObservabilityDestinationResponse, components.GetObservabilityDestinationResponse, components.UpdateObservabilityDestinationResponse and components.DeleteObservabilityDestinationResponse) and the management API keys guide. The page has no link that explains rate limits or the 409 conflict errors.

Data-handling risk: the page says that when privacy_mode is true, request and response bodies are not forwarded and only metadata is sent. When it is false, bodies may be forwarded, although the page does not show that every body is sent. The page does not give a default for privacy_mode, and the examples set it to False explicitly. If you send prompts to a third-party service, check the default and set the flags on purpose. The same goes for the identity and request-context metadata flags. Sampling_rate and api_key_hashes can narrow what is sent.

Operational notes: list hides destinations that are not stable, so its results may not show everything configured. Delete is a soft delete, and the page does not say whether a deleted destination can be recovered. The page shows that management keys are required and that workspace-scoped keys are limited to their own workspace, but any broader privileges of management keys are unknown from this page. The cost-allocation flag is labelled Beta, so its behaviour may change. The page was reviewed as text only and nothing was executed.

Why this assessment

The assessment rests on what the page states directly: the five operations, their parameters and required flags, the management-key requirement, the workspace rules, the limit of 5 destinations per type and the listed error types. These are quoted or closely paraphrased from the page.

Statements about how forwarding behaves in practice are inferences from parameter descriptions. For example, the page documents that privacy_mode true prevents request and response bodies from being forwarded. False may allow body forwarding, but the page does not establish that every body is sent. Points like this are marked as implications, not confirmed behaviour. Installation, pricing, licence, response contents and other destination types are reported as unknown because the page does not cover them.

Alternatives

The page does not compare itself with any other approach. It does not say whether the same management operations are available over direct HTTP, through SDKs in other languages or through a web dashboard, so all of those are unknown from this page. The top of the page points to a documentation index at [https://openrouter.ai/docs/llms.txt] that may list related pages, but that index was not captured. Another possible approach is to instrument an application directly with an observability vendor's own client library. This page offers no comparison, so how that approach stacks up against OpenRouter-side forwarding is unknown from this evidence.

Do not assume destinations capture all traffic. Sampling_rate, filter_rules, api_key_hashes, regions and privacy_mode can each narrow what is forwarded.

Evidence base

This report rests on one source: the complete selected documentation page at [https://openrouter.ai/docs/client-sdks/python/sdks/observability/README.md], captured on 2026-11-15. No SDK source code, package metadata, changelog, licence file, issue tracker or running service was examined.

The page's code snippets, parameter tables and error tables are the only source for every capability claim. No claim was checked against a live API or an installed SDK.

Access & freshness

Costs

The page gives no prices or rate limits. It does document one limit: at most five destinations per type. From this evidence it is unknown whether observability destinations are free, included in a plan or billed per event. It is also unknown whether OpenRouter charges separately for using a management key.

Costs on the destination side, such as a Langfuse plan, are outside this page. Do not confuse the broadcast_generation_cost flags with the cost of the feature itself. They only decide whether cost and billing data about your model calls is included in what gets forwarded.

Rights and licence

The captured page contains no licence, copyright notice or terms of use. The licence of the OpenRouter Python SDK and the terms for reusing the documentation are therefore unknown from this evidence. The code snippets are shown as usage examples, but no permission statement comes with them.

Because the page gives no licence or reuse permission, the rights to redistribute the documentation or the SDK are unknown. If you plan to copy the documentation or vendor the SDK, check the SDK repository's licence and OpenRouter's terms directly.

Freshness

The page was captured on 2026-11-15 at 11:16 UTC. It shows no publication date, last-updated date, SDK version or changelog, so how it compares with the current SDK is unknown. The Beta label on the cost-allocation flag and the stable-only handling of destination types suggest the feature set is still developing. Check the live page again before relying on any parameter name, limit or default.

Suggested next steps

If you use OpenRouter and want to try this, start in a non-production workspace. Create a management key by following OpenRouter's own guide, then use list and get to see what already exists before creating anything. When creating a destination, set privacy_mode, the four broadcast flags and sampling_rate explicitly, because the page does not state their defaults. Consider api_key_hashes to limit forwarding to specific keys.

Keep destination secret keys in environment variables or a secrets manager, not in source files. Check the real SDK signature for the type argument (type or type_). Read the linked pages for management keys, filter rules, regions and response models before building on this. Confirm licence and pricing separately, since neither appears on this page.

Evidence for this report

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