github.com/openrouterteam/python-sdk v1.1.122
GitHub Actions workflow definition pathVS Code devcontainer configuration file
SHA-256f5af20a79efbea6963ecef0e45cfbda649e3602a2382f80b18ce3ebd0dcd9bfb
MaleculeH(Cm)Md₂(Bk)
Evidence
1---
2title: "Files"
3description: "Files endpoints"
4---
5
6## Overview
7
8Files endpoints
9
10### Available Operations
11
12* [list](#list) - List files
13* [upload](#upload) - Upload a file
14* [delete](#delete) - Delete a file
15* [retrieve](#retrieve) - Get file metadata
16* [download](#download) - Download file content
17
18## list
19
20Lists files belonging to the workspace of the authenticating API key.
21
22### Example Usage
23
24```python
25from openrouter import OpenRouter
26import os
27
28
29with OpenRouter(
30 http_referer="<value>",
31 x_open_router_title="<value>",
32 x_open_router_categories="<value>",
33 api_key=os.getenv("OPENROUTER_API_KEY", ""),
34) as open_router:
35
⋯12 lines
53:531… | eyJjdXJzb3IiOiJvcl9maWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9 |
54| `workspace_id` …
57:383… | Anthropic-style forward cursor: the id to list after. …
97:24… iles.upload(file={
98 "file_name": "example.file",
99 "content": open("example.file", "rb"),
100 }, provider="openai")
101
102 # Handle response
103 print(res)
104
105```
⋯4 lines
1"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
3import re
4import json
5from dataclasses import dataclass, asdict
6from typing import (
7 Any,
8 Callable,
9 Generic,
10 List,
11 TypeVar,
12 Optional,
13 Generator,
14 AsyncGenerator,
15 Tuple,
16)
17import httpx
18
19T = TypeVar("T")
20
21
22class EventStream(Generic[T]):
23 # Holds a reference to the SDK client to avoid it being garbage collected
24 # and cause termination of the underlying httpx client.
25 client_ref: Optional[object]
26 response …
No evidence locations were recorded for this file. Raw result