Skip to main content
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 under 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).
OpenCode sees placeholder env vars (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:
See Python library.

Multi-account

The proxy uses each provider’s default connection. To switch which connection the proxy uses, set it as default with --force. See Multiple connections per provider.

Troubleshooting

What’s next

Run agents with the proxy

Full proxy walkthrough.

Generic Python agent

The library pattern for any Python script.