Skip to content

Commit 72eb004

Browse files
authored
feat: add helicone docs + helicone session tracking (anomalyco#5265)
1 parent e46080a commit 72eb004

2 files changed

Lines changed: 114 additions & 0 deletions

File tree

packages/web/src/content/docs/ecosystem.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ You can also check out [awesome-opencode](https://github.com/awesome-opencode/aw
1717

1818
| Name | Description |
1919
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
20+
| [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) | Automatically inject Helicone session headers for request grouping |
2021
| [opencode-skills](https://github.com/malhashemi/opencode-skills) | Manage and organize OpenCode skills and capabilities |
2122
| [opencode-type-inject](https://github.com/nick-vi/opencode-type-inject) | Auto-inject TypeScript/Svelte types into file reads with lookup tools |
2223
| [opencode-openai-codex-auth](https://github.com/numman-ali/opencode-openai-codex-auth) | Use your ChatGPT Plus/Pro subscription instead of API credits |

packages/web/src/content/docs/providers.mdx

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,119 @@ The `global` region improves availability and reduces errors at no extra cost. U
568568

569569
---
570570

571+
### Helicone
572+
573+
[Helicone](https://helicone.ai) is an LLM observability platform that provides logging, monitoring, and analytics for your AI applications. The Helicone AI Gateway routes your requests to the appropriate provider automatically based on the model.
574+
575+
1. Head over to [Helicone](https://helicone.ai), create an account, and generate an API key from your dashboard.
576+
577+
2. Run the `/connect` command and search for **Helicone**.
578+
579+
```txt
580+
/connect
581+
```
582+
583+
3. Enter your Helicone API key.
584+
585+
```txt
586+
┌ API key
587+
588+
589+
└ enter
590+
```
591+
592+
4. Run the `/models` command to select a model.
593+
594+
```txt
595+
/models
596+
```
597+
598+
For more providers and advanced features like caching and rate limiting, check the [Helicone documentation](https://docs.helicone.ai).
599+
600+
#### Optional Configs
601+
602+
In the event you see a feature or model from Helicone that isn't configured automatically through opencode, you can always configure it yourself.
603+
604+
Here's [Helicone's Model Directory](https://helicone.ai/models), you'll need this to grab the IDs of the models you want to add.
605+
606+
```jsonc title="~/.config/opencode/opencode.jsonc"
607+
{
608+
"$schema": "https://opencode.ai/config.json",
609+
"provider": {
610+
"helicone": {
611+
"npm": "@ai-sdk/openai-compatible",
612+
"name": "Helicone",
613+
"options": {
614+
"baseURL": "https://ai-gateway.helicone.ai",
615+
},
616+
"models": {
617+
"gpt-4o": {
618+
// Model ID (from Helicone's model directory page)
619+
"name": "GPT-4o", // Your own custom name for the model
620+
},
621+
"claude-sonnet-4-20250514": {
622+
"name": "Claude Sonnet 4",
623+
},
624+
},
625+
},
626+
},
627+
}
628+
```
629+
630+
#### Custom Headers
631+
632+
Helicone supports custom headers for features like caching, user tracking, and session management. Add them to your provider config using `options.headers`:
633+
634+
```jsonc title="~/.config/opencode/opencode.jsonc"
635+
{
636+
"$schema": "https://opencode.ai/config.json",
637+
"provider": {
638+
"helicone": {
639+
"npm": "@ai-sdk/openai-compatible",
640+
"name": "Helicone",
641+
"options": {
642+
"baseURL": "https://ai-gateway.helicone.ai",
643+
"headers": {
644+
"Helicone-Cache-Enabled": "true",
645+
"Helicone-User-Id": "opencode",
646+
},
647+
},
648+
},
649+
},
650+
}
651+
```
652+
653+
##### Session tracking
654+
655+
Helicone's [Sessions](https://docs.helicone.ai/features/sessions) feature lets you group related LLM requests together. Use the [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) plugin to automatically log each OpenCode conversation as a session in Helicone.
656+
657+
```bash
658+
npm install -g opencode-helicone-session
659+
```
660+
661+
Add it to your config.
662+
663+
```json title="opencode.json"
664+
{
665+
"plugin": ["opencode-helicone-session"]
666+
}
667+
```
668+
669+
The plugin injects `Helicone-Session-Id` and `Helicone-Session-Name` headers into your requests. In Helicone's Sessions page, you'll see each OpenCode conversation listed as a separate session.
670+
671+
##### Common Helicone headers
672+
673+
| Header | Description |
674+
| -------------------------- | ------------------------------------------------------------- |
675+
| `Helicone-Cache-Enabled` | Enable response caching (`true`/`false`) |
676+
| `Helicone-User-Id` | Track metrics by user |
677+
| `Helicone-Property-[Name]` | Add custom properties (e.g., `Helicone-Property-Environment`) |
678+
| `Helicone-Prompt-Id` | Associate requests with prompt versions |
679+
680+
See the [Helicone Header Directory](https://docs.helicone.ai/helicone-headers/header-directory) for all available headers.
681+
682+
---
683+
571684
### llama.cpp
572685

573686
You can configure opencode to use local models through [llama.cpp's](https://github.com/ggml-org/llama.cpp) llama-server utility

0 commit comments

Comments
 (0)