Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
lockVersion: 2.0.0
id: 9eea3e30-2722-4060-973b-57b7f1f75dc0
management:
docChecksum: ea28f73445d5aaf00200db46ac3c5ef3
docChecksum: 7330d36e97b07f1851892f4754312cfd
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
releaseVersion: 0.9.9
configChecksum: 04ef64a6bd1d23c094ab865366d391fa
releaseVersion: 0.9.10
configChecksum: a295021e1371031305df688e06e08280
repoURL: https://github.com/OpenRouterTeam/go-sdk.git
installationURL: https://github.com/OpenRouterTeam/go-sdk
persistentEdits:
generation_id: cb3c1aa0-de9a-4ff1-a35a-71e0ddf12487
pristine_commit_hash: eae091031016319c6a968f48dfe6afdfe3cf1e09
pristine_tree_hash: 04c580c54522d695b17f24fbe1987c415878f579
generation_id: 85dda561-584e-4180-959e-ec6583676358
pristine_commit_hash: 3e3cb8003219ab11f5c314bb7a4826e5e0a1a703
pristine_tree_hash: 52300c4a10ccca39bc118d1fb439ed1dd73c8562
features:
go:
acceptHeaders: 2.81.2
Expand Down Expand Up @@ -105,8 +105,8 @@ trackedFiles:
pristine_git_object: 300f5ee15b73e7ecfd6b16e25d132ad1e4af8442
chat.go:
id: 81535ccb3ff5
last_write_checksum: sha1:3fe05c99a2a3f927bac689dc6dd9f0e6c51bc7b3
pristine_git_object: fedc9b46b5d2a7a4fc521b1af68b563cf4e116d8
last_write_checksum: sha1:bf12b147b40656ae0086e01601410f01ae94e039
pristine_git_object: 3ec067932ab585739098c417f40010f895bed95e
classifications.go:
id: 711367120ab6
last_write_checksum: sha1:1503d324707d56ecefdc2ec29ada40857bbff956
Expand Down Expand Up @@ -8225,8 +8225,8 @@ trackedFiles:
pristine_git_object: 8f349e35ba308d4dbdc5c3ea0a1678321ab6514b
docs/models/operations/listcontainerfilesrequest.mdx:
id: f92bb567b314
last_write_checksum: sha1:fb60ee8d588c0294d257ec0b296c5c25f3acd11a
pristine_git_object: 873b46fbab0fe3578d3c531715c0b3de938becdb
last_write_checksum: sha1:e4c9d2f61a213fa9b3914b84a4483c64ad3c1da2
pristine_git_object: 3074faa6b95de965ac22e349479614da8a98296a
docs/models/operations/listdata.mdx:
id: 50698a46e95c
last_write_checksum: sha1:8f8c5acd6a9e1a237c21caf7c94cfc71bf55f426
Expand Down Expand Up @@ -8845,8 +8845,8 @@ trackedFiles:
pristine_git_object: 1ba80d0ada312235511d6006847d3264aa61283b
docs/sdks/containers/README.mdx:
id: cc963972ad75
last_write_checksum: sha1:36b0cd700a1c46b22812e866d6d72f5e6e7b4d2a
pristine_git_object: c60dad84f4c68b460ea108ed1bf6a9aac1a29a02
last_write_checksum: sha1:7eeb263dda8c81fbdf9834b72717770b66f0782f
pristine_git_object: 11013aa8d86c2f7befad4d05f6227e9b8f658c80
docs/sdks/credits/README.mdx:
id: 2ba51de8de3f
last_write_checksum: sha1:6840c872a50554a58c33f3ef4533ce21af8b6247
Expand Down Expand Up @@ -12605,8 +12605,8 @@ trackedFiles:
pristine_git_object: 574fcf1eab6057af97296ef35bf6b97ab725582c
models/operations/listcontainerfiles.go:
id: a5d7da5fd18e
last_write_checksum: sha1:e80272ac062e53f6aa176da6ebe7928a12d54a6f
pristine_git_object: 6c6926e49bf0b9107780e903a8bdde6676768c90
last_write_checksum: sha1:3a8ea810e8c7ebbb88c7f50550442ac36e94d1a1
pristine_git_object: 68d8b3cedd38307fd16b4c4c4e222d898c04e5fb
models/operations/listembeddingsmodels.go:
id: cb1333992087
last_write_checksum: sha1:105c804e688e5843f80c09e4562df4f08f3181dc
Expand Down Expand Up @@ -12913,8 +12913,8 @@ trackedFiles:
pristine_git_object: 5e3a2cdf8cb4ed4f5378b712293cba9c82074f16
openrouter.go:
id: 207ad004b774
last_write_checksum: sha1:06474f4f87f7096780907fdb3dafc13f2841bb5f
pristine_git_object: eda1b766ba47965f651ae75830245513c88d6a98
last_write_checksum: sha1:198326a10294443e18c32b6d3c355eb2151cc96d
pristine_git_object: 618370f539c702193aff1c1f8ad01774c71a5610
optionalnullable/optionalnullable.go:
id: ce60f259ead3
last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
go:
version: 0.9.9
version: 0.9.10
additionalDependencies: {}
baseErrorName: OpenRouterError
clientServerStatusCodesAsErrors: true
Expand Down
4 changes: 2 additions & 2 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35691,12 +35691,12 @@ paths:
maximum: 1000
minimum: 1
type: 'integer'
- description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path.'
- description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.'
in: 'query'
name: 'after'
required: false
schema:
description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path.'
description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.'
example: 'cfile_b3V0L3JlcG9ydC5jc3Y'
type: 'string'
responses:
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.787.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:8a427f5d7fc1e0ef614462d1fdcbda3eb601e25cb6a63c9f419224de83b15d47
sourceBlobDigest: sha256:ce7769e5f691b863f0c923c61a1bce14276837303a8b2392030410e09c7b6375
sourceRevisionDigest: sha256:c35a87cdb77d5a73e3234ae12ddfa96b81e377d516db003a638e040d769375df
sourceBlobDigest: sha256:744f4c260c5a2af3f132b1238b6498a776f67220fc60462b2c6e5b5d7f02041d
tags:
- latest
- 1.0.0
targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:8a427f5d7fc1e0ef614462d1fdcbda3eb601e25cb6a63c9f419224de83b15d47
sourceBlobDigest: sha256:ce7769e5f691b863f0c923c61a1bce14276837303a8b2392030410e09c7b6375
sourceRevisionDigest: sha256:c35a87cdb77d5a73e3234ae12ddfa96b81e377d516db003a638e040d769375df
sourceBlobDigest: sha256:744f4c260c5a2af3f132b1238b6498a776f67220fc60462b2c6e5b5d7f02041d
codeSamplesNamespace: open-router-chat-completions-api-go-code-samples
codeSamplesRevisionDigest: sha256:e57d80e08cf6a69c8b00ba70c4674fe199c2220f22f4ff5ca419abc7782bc40a
codeSamplesRevisionDigest: sha256:e0cbb1558472668de3ff4d7518a51a52addda95a5ae7b9da95be3fd08a2ff172
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
Expand Down
2 changes: 1 addition & 1 deletion OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ go get github.com/OpenRouterTeam/go-sdk
For beta releases, pin an explicit version:

```bash
go get github.com/OpenRouterTeam/go-sdk@v0.9.9
go get github.com/OpenRouterTeam/go-sdk@v0.9.10
```

**Requirements:** Go 1.25 or higher
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To learn more, see the [API Reference](https://openrouter.ai/docs/sdks/go/api-re
> This SDK is in **beta**. Pin to a specific version to avoid unexpected breaking changes:
>
> ```bash
> go get github.com/OpenRouterTeam/go-sdk@v0.9.9
> go get github.com/OpenRouterTeam/go-sdk@v0.9.10
> ```

<!-- No Summary [summary] -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2608,4 +2608,14 @@ Based on:
### Generated
- [go v0.9.9] .
### Releases
- [Go v0.9.9] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.9 - .
- [Go v0.9.9] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.9 - .

## 2026-09-30 06:22:16
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.9.10] .
### Releases
- [Go v0.9.10] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.10 - .
14 changes: 14 additions & 0 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ import (
"net/url"
)

// Chat - Stream a chat completion with an intern
// Sends a prompt to one of your interns and streams the reply as OpenAI-compatible server-sent events ending with `[DONE]`. The run executes on the intern, which may pause to ask you something. It then streams one `openrouter.provide_input` tool call and finishes with `finish_reason: "tool_calls"`, and the run stays open on the intern.
//
// Every response, whether it ends with `stop`, `tool_calls` or `error`, is followed by a final chunk with empty `choices` that carries `session_id`, then `data: [DONE]`. That chunk carries the `usage` the intern reported for the run, after `stop` or `error`, and `null` when the intern reported none. After `tool_calls` its `usage` is `null` because the turn is not over. Read through `[DONE]`: the `session_id` you need to reply arrives after the `tool_calls` finish chunk.
//
// To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline.
//
// Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent.
//
// A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event.
//
// Set `approval_mode` to `manual` to have the intern ask before approval-bearing tools such as the shell. Omitted, the run self-drives and consents on your behalf. The mode belongs to the run started by that prompt and must be repeated on later prompts.
//
// Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`.
type Chat struct {
rootSDK *OpenRouter
sdkConfiguration config.SDKConfiguration
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ provider selection, and unified billing.

This SDK is in beta. Pin to a specific module version to avoid unexpected breaking changes:

go get github.com/OpenRouterTeam/go-sdk@v0.9.9
go get github.com/OpenRouterTeam/go-sdk@v0.9.10

For full API documentation, visit: https://openrouter.ai/docs/client-sdks/go/overview

Expand Down
Loading
Loading