OpenCode is an open-source AI coding agent. It runs as a CLI, calls LLMs over HTTPS, and shells out to local tools. Authsome plugs in via the same two patterns we use everywhere: wrap the agent underDocumentation Index
Fetch the complete documentation index at: https://agentr-feature-env-backed-identity-loading.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
authsome run --, or call the library from inside.
The agent drives login. When OpenCode hits a missing credential it can run
authsome login <provider> itself, opening a browser on your machine for OAuth consent. Don’t paste keys into prompts; pre-seed a credential only when an agent can’t reach a browser (CI, SSH).Recommended pattern: wrap the agent
OPENAI_API_KEY=authsome-proxy-managed) but never the real key. Outbound HTTPS to matched provider hosts is authenticated by the proxy.
Embedding the library
If you’re orchestrating OpenCode from a larger Python program and need explicit per-call control, drop below the proxy:Multi-account
--force. See Multiple connections per provider.
Troubleshooting
| Symptom | Fix |
|---|---|
OPENAI_API_KEY rejected as invalid | OpenCode is running outside authsome run. Wrap it. |
TLS errors against api.openai.com | Trust the mitmproxy CA. See Proxy networking. |
What’s next
Run agents with the proxy
Full proxy walkthrough.
Generic Python agent
The library pattern for any Python script.