Use OpenCode with the Straitly API
Use OpenCode with Straitly in 4 steps: add a straitly provider with baseURL https://api.straitly.ai/v1 to opencode.json and pick a model with /models. Claude Sonnet 5.5 then costs $1.20 in and $6.00 out per 1M tokens, 40% under its list price of $2.00 and $10.00.[1][3]
Updated
- Setting
- ~/
.config/ opencode/ opencode.json - Base URL
- https://
api.straitly.ai/ v1 - API key
- sk-YOUR_KEY
- API format
- OpenAI-compatible
- Connect with
- opencode.json provider
Your prompts, files and workflow stay as they are. From OpenCode's docs, checked 16 November 2026[1]
OpenCode in 4 steps.
Replace sk-YOUR_KEY with your own key from the Keys page. Setting lives in ~/.config/opencode/opencode.json, base URL https://api.straitly.ai/v1.
Step 1: Get a Straitly key
Sign up with email or Google, add credits from $5 (no subscription, no minimum), then create a key on the Keys page. It starts with sk-. Keep it private.
Step 2: Put the key in your environment
The provider block reads the key from STRAITLY_API_KEY, so export it in the shell that starts OpenCode.
Terminal · Mac / Linux
export STRAITLY_API_KEY="sk-YOUR_KEY"Step 3: Add the Straitly provider
Add this provider to ~/.config/opencode/opencode.json. Each key under models is a Straitly model ID; add any you want from the models page.
~/.config/opencode/opencode.json
{ "$schema": "https://opencode.ai/config.json", "providers": { "straitly": { "name": "Straitly", "env": ["STRAITLY_API_KEY"], "package": "@opencode/ai/providers/openai-compatible", "settings": { "baseURL": "https://api.straitly.ai/v1" }, "models": { "claude-sonnet-5-5": { "name": "Claude Sonnet 5.5" }, "z-ai/glm-5.3": { "name": "GLM-5.3" } } } } }Step 4: Pick a Straitly model
Restart OpenCode, open /models and choose a model from the Straitly group, or start with one directly.
Terminal
opencode -m straitly/claude-sonnet-5-5
Checked against OpenCode's own docs, 16 November 2026
- OpenCode: providers[1] (opencode.ai)
Config names and menu paths match these pages as of the date shown. If OpenCode changes them, its docs win.
What happens to a OpenCode request?
Two settings change in OpenCode: where requests go and which key pays for them. Everything else, from your prompts to your workflow, stays as it is.
OpenCode, as it is
Your prompts, files and workflow stay as they are. The request leaves in the same format as before.
One address, one key
It goes to
https://api.straitly.ai/v1with your Straitly key. That is the whole setup.[1]The same models
The key reaches 117 models. You ask for each one by its model ID.[4]
A smaller bill
Claude Sonnet 5.5 for 10M input tokens and 1M output tokens costs $18.00 against $30.00 at list.[3]
OpenCode on Straitly in numbers
- 4
- Steps to connect OpenCode[1]
- 40%
- Straitly under the provider's list price, on most models[2]
- $18.00
- Claude Sonnet 5.5 for 10M input tokens and 1M output tokens, against $30.00 at list[3]
- 117
- Models one key reaches from OpenCode[4]
- $5
- Smallest top-up. No subscription and no minimum[4]
- $0
- Charged for failed requests[2]
- 98 of 103
- Models with a list price that are at least 40% under it[3]
- 134 of 145
- Models priced under the lowest OpenRouter seller[3]
OpenCode questions.
Ask a question- Add it under providers in opencode.json with a name, the env variable that holds the key, the openai-compatible package, settings.baseURL and the models you want, per OpenCode's provider docs.
- https://api.straitly.ai/v1, with /v1. OpenCode's openai-compatible package adds the endpoint paths after it.
- In a Straitly group in the /models picker, named by the IDs you listed under models.
- On 2026-11-25 Straitly charged $0.416 input and $1.39 output per 1M tokens for GLM-5.3, against a list price of $1.40 and $4.40: 68% under list on input and output alike.
- Yes. The straitly entry sits next to them under providers. Switch between them in /models.
Sources
Setup steps follow OpenCode's own documentation, read on the date shown. Prices come from Straitly's public catalog.
What each source says
- [1] OpenCode: providers
- Add an OpenAI-compatible provider under providers with env, package, settings.baseURL and models; pick it with /models.
- [2] Straitly pricing
- Billed per token at the pooled rate, 40% under the provider's published rate on most models, with nothing added on top. Failed requests cost nothing. No subscription, no minimum.
- [3] Straitly public catalog
- Every model ID with Straitly's price, the lab's official list price where one is published, and the lowest OpenRouter seller including its 5.5% credit fee.
- [4] Straitly home page
- One OpenAI-compatible API for 117 models. Sign up with email or Google, top-ups from $5 with no card or platform fee, base URL https://api.straitly.ai/v1, and requests move to another provider serving the same model if one goes down.
Which other tools use the same key?
- Claude CodeAnthropic Messages. Env vars or settings.json.
- CursorOpenAI-compatible. Settings, no script.
- CodexOpenAI Responses. config.toml provider.
- ClineOpenAI-compatible. Settings, no script.
- Claude appAnthropic Messages. Developer menu gateway.
- HermesOpenAI-compatible. Custom endpoint.
- OpenClawOpenAI-compatible. Custom provider.
- OpenAI SDKOpenAI-compatible. Python client.
- Anthropic SDKAnthropic Messages. Python client.
- LangChainOpenAI-compatible. Python client.
- LlamaIndexOpenAI-compatible. Python client.
- Vercel AI SDKOpenAI-compatible. TypeScript client.
Start with one request.
Prepaid, no subscription, no minimum. 40% under list on most models you reach from OpenCode.