Credential proxy
Point OpenCode at shared model access through a credential proxy.
On this page
The Evident-hosted credential proxy is the recommended default for a team: it lets OpenCode use models from a shared pool while provider credentials stay with the proxy. Use it for a local OpenCode client or for managed runners created by a Swarm's Provisioner. You can also connect customer-operated infrastructure in your own AWS account. Evident gives each connected client a dedicated inference token and address; you configure its OpenCode provider. For the ordered path from a new Evident team to a first Slack reply, start with the MicroVM quickstart.
Create an Evident-hosted pool
-
Open Settings → Credentials. The page is available at
/settings/credentials. - In Managed, select Create pool, enter a Pool name, and confirm the dialog.
- Open the new pool from the overview. On the pool page, select Connect provider and complete a provider connection. The credential row shows safe metadata and subscription usage without revealing the provider secret or raw identifier.
The available methods include a pasted authorization result for Claude, a pasted callback URL for Google Antigravity, device sign-in for ChatGPT, Kimi Coding, and xAI Grok, and browser-encrypted API keys for OpenAI Platform and Mistral. After you approve Google Antigravity, the supported loopback callback shows a browser connection error. Copy the full callback URL from the address bar and paste it into the authorization result field. You manage Mistral plans and pay-as-you-go billing in your Mistral account.
Choose how a pool routes sessions
Routing is configured separately for each pool. New pools use Packing and have Soft session affinity turned on. Packing uses the order in which you attached subscriptions to the pool: new or unbound sessions use the first eligible subscription before moving to later subscriptions.
Routing choices for the pool are managed on the Routing tab. Choose Round-robin to distribute new sessions across the pool's available subscriptions. Packing and soft session affinity are independent settings. Packing can improve provider cache locality, but it does not guarantee a cache hit or predict a quota.
Enable Soft session affinity when you want an identified conversation to stay on its current subscription while that subscription remains authorized and available. Affinity takes precedence over packing. If the subscription is revoked, removed, cooling, or otherwise unavailable, the conversation moves to another eligible subscription and stays there when the original subscription recovers. The proxy checks authorization and availability again for each request. A client that does not identify its conversation uses the selected strategy normally.
Affinity is held in proxy memory for one hour of inactivity, with the expiry refreshed when the conversation is used. A proxy restart drops the binding, so the next request selects a subscription again. A conversation using two models has a separate binding for each model. Affinity therefore does not promise one subscription for every model used by one conversation.
The tested managed builds, OpenCode V1 1.18.35 and OpenCode V2
0.0.0-beta-17823, send X-Session-Id and
X-Session-Affinity with a stable session value. Evident uses the first header and
falls back to the second. Other clients must send one of these headers for affinity to apply.
Older proxy support and provider limits
If the proxy has not reported routing support, the dashboard says that routing settings are not active yet. The settings remain saved, but new sessions continue using round-robin until the proxy is updated and reports support. This prevents an older proxy from silently ignoring your choice.
Packing advances when the pinned proxy recognizes a provider limit. If the provider response is
not recognized, the proxy uses its generic cooldown path and still advances instead of staying
on an exhausted subscription. Source inspection and controlled boundary tests cover the pinned
CLIProxyAPI v8.0.33 behavior, including Claude five-hour and seven-day rejections,
missing reset information, model-scoped limits, recovery, and the all-subscriptions-limited
response. No real Anthropic limit was observed. The provider's unified rate-limit headers are
undocumented and can change, so Evident does not promise universal provider signaling or exact
quota prediction.
If a stream has already delivered bytes when a subscription limit or provider error occurs, Evident does not replay the partial stream. You receive the upstream error. Cache locality is a possible benefit of packing, not a guarantee.
Hosted availability and permissions
The hosted section reports why you cannot create a pool instead of offering an action that fails:
- Hosted credentials are not configured means the environment has no shared service. There is no per-team request to make.
- Hosted credentials are not ready means the shared service is configured but its runtime has not registered.
- Hosted enrollment is disabled means an operator has disabled enrollment for your team.
- Hosted pool creation unavailable appears while Evident checks your team permission, when only an owner or admin can continue, or when permission cannot be confirmed.
- Hosted pools are read-only means the hosted service has not granted your account pool-management permission.
- Hosted credentials could not be loaded or Credentials could not be loaded shows the reported failure instead of an empty or successful state.
Set a credential default for provisioned runners
- Create and connect providers to the credential pool that new runners should use.
- Open the runner pool and find Default credential pool in its Provisioner settings.
- Choose the credential pool and select Save default. Only credential pools currently authorized for your team are offered.
The default applies only to runners the Provisioner creates after you save it, whether you select Create runner or a per-person rule creates the runner. Existing runners and explicit choices stay unchanged. Select No default to leave future runners on the manual setup path; clearing the default does not disconnect earlier managed runners.
If the default is deleted or no longer authorized, creation stops with an actionable error. Evident does not silently send the new runner to another pool or directly to a model provider.
Create an inference token
Use this flow to create a standalone inference token. An associated runner receives its credential on its next start when eligible; use the Associate or disconnect a runner section below to manage runner assignments.
- In an Evident-hosted pool, open the Inference tokens tab and select Create inference token.
- Enter a Client name of up to 100 characters.
- Select Create inference token. Local client ready shows the one-time credential and inference address, and links to this guide for provider configuration. Copy the credential before closing the dialog because it cannot be shown again.
- Select Copy one-time token. The label changes to Token copied when the clipboard write succeeds. If copying fails, the visible token remains selectable for manual copying until you select Done.
For an Evident-hosted pool, the pool page keeps the reusable, secret-free configuration behind Setup instructions. Select it when you need to configure a standalone client; the full instructions do not occupy the client list by default. Runner credential recovery is available from the information control on the runner's credential card.
The client list shows only safe metadata: the client name, an Active or Revoked label, a token prefix, creation time, and revocation time when applicable. It never shows the complete token. Select Rotate to replace a credential and reveal its replacement once. Select Revoke to remove access without creating a replacement. The confirmation names the client and explains when the deployment applies the change.
Understand managed runner setup
On a managed MicroVM runner's cold start, the runner receives a credential scoped to its pool
assignment and stores it in its protected credential store. OpenCode reads the token from
EVIDENT_PROXY_TOKEN. By default, Evident does not change the runner's provider
configuration. Configure a provider using the examples below. Evident stores only a hash and
safe lifecycle metadata.
A runner you start yourself, such as a local runner or a container whose command you control,
can pass --auto-configure-credentials-proxy to install generated providers. A
MicroVM runner's boot hook builds the CLI arguments, so request the opt-in through the
construct's autoConfigureCredentialsProxy prop rather than on a command line; see
the AWS runner guide for the published prop availability and
workaround.
The inference address for a managed runner is available from its pool's
Setup instructions control. Provider credentials remain in the credential
proxy and are never delivered to the runner.
Automatic credential delivery requires evident run to authenticate as the runner
with a runner key. A personal sign-in cannot manage a runner's credentials. See the local
runner guide's runner-key setup.
For a local runner:
- Associate the runner with this pool in Associated runners. See the runner association steps if needed.
- Create a runner key in the API keys section of the runner's settings.
-
Set the key for the runner process and start it with automatic provider configuration:
EVIDENT_RUNNER_KEY=<runner-key> evident run --auto-configure-credentials-proxy - In OpenCode, select a model from an
evident-…provider.
Managed inference ready appears after the runner confirms credential storage and the proxy confirms policy readiness. The detail says whether Evident installed and validated the provider configuration, whether you manage it, or whether no configuration claim is available. The runner can still connect its tunnel for diagnostics and non-inference work while managed inference is not ready. Resuming a suspended runner reuses and confirms the credential already held by its serving OpenCode process; it does not rotate the credential merely because the runner resumed.
Recover managed setup
| What you see | Recovery |
|---|---|
| Waiting for credential delivery | The runner hasn’t confirmed receiving its proxy token yet. |
| The runner could not apply the credential locally | Restart the runner. Its tunnel can remain connected and the delivered credential remains live until the next cold start replaces it and retries setup. |
| The credential proxy policy refresh failed | Restore proxy connectivity and retry acknowledgment. The runner has already applied its local configuration, so restarting to repair local setup is not the remedy. |
| Waiting for runner restart after reassignment | Read the detail carefully. The runner restart was requested means an online runner accepted the request. A replacement is staged means no restart was requested; the replacement takes effect on the next cold start. |
A managed reassignment keeps the old assignment and credential active until the replacement is acknowledged. It never reveals the replacement token in the browser. Use the manual client setup and recovery controls for local clients and runners without an active managed assignment.
If issuing a client shows Shared proxy upgrade required, an operator must upgrade the shared proxy before the team can issue local clients. Existing runners are unaffected. If you cannot manage the pool, the Associated runners and Inference tokens controls are read-only, and the associate, create, issue, rotate, and revoke controls are unavailable.
Register a customer-operated proxy
Customer-operated infrastructure remains the secondary path for teams that operate and secure their own proxy in AWS with S3-compatible storage.
What you need before you start
- You provide in your own AWS account: a VPC with a route to the public internet for the task to reach the registry, Secrets Manager, AWS S3, CloudWatch Logs, provider token endpoints, and the Evident API; a runner security group that can reach inference; two ACM certificates, one per hostname, for distinct management and inference hostnames; DNS records that alias each hostname to its load balancer; and three Secrets Manager secrets for the management secret, configuration pull credential, and registry pull credential.
- Evident provides: the
@evident-ai/runner-proxy-cdkpackage as a buildable source tree. It is not published on npm, so there is no registry package to install. Evident also provides access to the proxy container image, which is distributed privately and is not available for anonymous pull. Request registry access or a copy to mirror into your own registry.
The construct creates the encrypted S3 credential bucket for you; you supply only a deployment prefix, not a bucket.
-
Under Customer-operated, select New proxy. Enter its
Name and Inference URL in the modal, then select
Create proxy. After the proxy is created, under
Credential pools, select Create pool. Enter a
Pool name in the modal, then select Create pool. Open the
new pool. Read the deployment ID from the address bar:
/settings/credentials/deployments/<deployment-id>/pools/<pool-id>. Use that value for the CDK construct'sdeploymentIdinput. - Under Management secret, select Generate secret and confirm the action. The Management secret generated dialog reveals the value once. Copy it and store it securely before selecting Done.
- Under Configuration pull credential, select Generate credential and confirm the action. The Pull credential generated dialog also reveals its value once. Copy it and store it securely before selecting Done.
-
Provision a reachable proxy with the deployment identity, management secret, configuration
pull credential, inference address, and credential storage. Follow the CDK construct's inputs,
caller-app build, certificate, DNS, network, and verification steps in
aws/runner-proxy-cdk/README.md, which ships inside the source tree Evident provides. Keep the management and inference addresses distinct. Create both generated secrets in AWS Secrets Manager before the task starts because the container reads them at startup. - Return to the deployment and expand Advanced settings. Under Management endpoint, enter the registered management address in Public HTTPS URL. Use the HTTPS hostname covered by the management certificate, not the raw load balancer hostname.
- Select Check. After the candidate succeeds, select Save endpoint. Saving performs a second server challenge before it stores the management endpoint.
- Confirm that Registration shows Registered and a current Encryption key generation. Connect Claude remains unavailable until the proxy reports that key.
- Under Credential pools, open the pool, select Connect provider, and complete the provider connection.
Associate or disconnect a runner
These steps apply to a runner that does not have an active managed assignment.
- In the pool's Associated runners section, select Associate runner, then select a runner.
- A runner without a team is disabled as No team assigned. A runner connected to another pool is disabled with Connected to that pool and the instruction to disconnect it there first. A runner already connected to this pool is disabled as Already connected to this pool.
- Select Associate runner. The runner receives its credential on its next start when eligible. If it has no live credential, select Issue token on its credential card to issue one now, then configure the provider using this page.
- Select Disconnect on the runner's row to remove its pool connection and proxy credentials without deleting the runner.
Manage a runner's inference credential
A runner without an active managed assignment with a live credential offers Rotate and Revoke on its credential card. Runners with managed assignments use managed runner operations instead of manual credential controls. Rotation reveals the replacement credential once. Revocation creates no replacement. The current credential stops working once the deployment applies the change. The change is sent right away and takes effect no later than the end of the policy freshness window if delivery fails.
If the runner has no live credential, its credential arrives automatically on its next start when eligible. If it does not, select Issue token on the runner's credential card to issue one now. Evident never rotates, revokes, or reissues a credential merely to show setup guidance.
Find a runner's setup instructions again
Select Setup instructions on a connected runner's row, including a managed runner created by a pool Provisioner. This guide is available for Evident-hosted and customer-operated pools. Opening it does not reveal, issue, rotate, or revoke a credential. It does not change the runner or its OpenCode configuration.
The guide identifies the OpenCode project configuration, explains how to keep the credential in the OpenCode process environment, and shows how to point a provider at the proxy without replacing unrelated providers or plugins. It also explains how to select a model and run one request to check the setup. Evident does not display a configured or verified state for the runner.
Change a runner's credential pool
- Select Change credential pool on the runner's row and choose another pool on the same deployment. To use a pool on another deployment, start from Associate runner in that pool instead.
- Select Continue. Before anything changes, the confirmation names the runner, source pool, and destination pool. It explains that the runner is briefly connected to no pool, its source credential is deleted, and you must apply the destination configuration manually. Select Cancel to return without changing the runner.
- Select Change pool to disconnect, connect, and issue the destination credential in sequence. This is not an atomic move and Evident does not roll back an earlier successful step if a later step fails.
- For an ordinary failure, use Retry disconnect, the retry action that names the destination pool, or Retry issuing the credential. The retry resumes that step without repeating an earlier successful step. If the runner, destination, or assignment changed or was deleted, the dialog shows the server's cause without guessing the current state. Refresh the page, find the runner's current pool, and reselect a pool or recover with Associate runner. If the runner has no credential, it receives one automatically on its next start; use Issue token on its credential card when needed.
- After all three steps succeed, copy the destination credential once. Replace the source pool's provider entry and credential value, while leaving unrelated providers, plugins, and settings unchanged.
Use only an inference credential in OpenCode
Use the dedicated, show-once inference token for either a runner or local client. Set it as
EVIDENT_PROXY_TOKEN in the environment that runs OpenCode; never print or log it.
Use the deployment's inference address and the served model IDs shown in the pool's model list.
Do not use a management or configuration-pull secret, the proxy's management address, or an Evident control-plane key for inference. Management, configuration pull, control-plane access, and inference use separate credentials and trust domains.
Add the proxy provider
For a hosted pool, select Connect provider and choose an available sign-in method.
For Claude, paste the authorization result shown by the provider. For Google Antigravity, approve
access, ignore the expected browser connection error, and paste the full callback URL from the
address bar.
Replace the placeholders below with the deployment's inference address. Merge the provider
entries into
opencode.jsonc if it exists, otherwise opencode.json; do not replace the
file or its unrelated providers and plugins. If an Evident runner image has
RUNNER_OPENCODE_CONFIG pointing to an existing source file, that source is copied
over the workspace project configuration at startup. Add the provider entries to the source
configuration so a later start does not replace the workspace edit.
When you use --auto-configure-credentials-proxy, generated configuration keeps each
provider distinct: Claude uses
evident-claude, Codex uses evident-codex, OpenAI Platform uses
evident-openai, Kimi uses evident-kimi, Google Antigravity uses
evident-antigravity, xAI Grok uses evident-xai, and Mistral uses
evident-mistral. Claude uses the native Messages path; Codex and OpenAI Platform use
the native Responses path; Kimi, Google Antigravity, xAI Grok, and Mistral use the native Chat
Completions path. Select a model with its namespaced identifier.
Anthropic
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"anthropic": {
"options": {
"baseURL": "https://<inference-base-url>/v1",
"authToken": "{env:EVIDENT_PROXY_TOKEN}"
}
}
}
} OpenAI
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openai": {
"options": {
"baseURL": "https://<inference-base-url>/v1",
"apiKey": "{env:EVIDENT_PROXY_TOKEN}"
}
}
}
}
The marked examples use placeholders and an environment reference so they remain safe to
publish. Each provider uses its own credential option: OpenAI uses apiKey, while
Anthropic uses authToken.
Understand stock provider overrides
The default examples override stock openai and anthropic. This redirects
all traffic in each overridden namespace through the proxy. A model that the pool does not serve
fails with model not found; it does not fall back to the original provider. A stock
anthropic override can also conflict with opencode-claude-auth, which
supplies Anthropic subscription credentials.
Keep direct and proxied providers side by side
Use distinct custom provider IDs when you need direct or subscription access alongside proxied
access. For example, keep the stock providers unchanged and add my-openai and
my-anthropic:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"my-openai": {
"npm": "@ai-sdk/openai",
"options": {
"baseURL": "https://<inference-base-url>/v1",
"apiKey": "{env:EVIDENT_PROXY_TOKEN}"
}
},
"my-anthropic": {
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "https://<inference-base-url>/v1",
"authToken": "{env:EVIDENT_PROXY_TOKEN}"
}
}
}
}
Select proxied models through the custom namespace, such as
my-openai/<served-model-id> or
my-anthropic/<served-model-id>. The exact model list comes from the pool. The
automatic opt-in remains separate and uses Evident-owned evident-… namespaces.
OpenCode configuration and verification
Evident does not change the OpenCode project configuration unless a runner you start yourself
explicitly passes --auto-configure-credentials-proxy or a MicroVM image requests
it through the construct's autoConfigureCredentialsProxy prop. Evident does not
report whether a client is configured or verified.