mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
docs: Mintlify MDX docs + docs.json; bump Speakeasy to 1.787.0 (#382)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "OpenRouter Python SDK"
|
||||
sidebarTitle: "Overview"
|
||||
description: "Python SDK for building AI features against 400+ models through OpenRouter."
|
||||
---
|
||||
|
||||
The OpenRouter Python SDK gives you type-safe access to 400+ models across
|
||||
providers through a single unified API, with both sync and async clients.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install openrouter
|
||||
```
|
||||
|
||||
## Quickstart
|
||||
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
with OpenRouter(
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
res = open_router.chat.send(
|
||||
messages=[
|
||||
{"content": "What is the capital of France?", "role": "user"},
|
||||
],
|
||||
stream=False,
|
||||
)
|
||||
print(res)
|
||||
```
|
||||
|
||||
## API reference
|
||||
|
||||
Browse the API reference for each resource in the sidebar. Type definitions for
|
||||
every request, response, and model are linked inline from each resource page.
|
||||
Reference in New Issue
Block a user