# OpenRouter temporary access

[Temporary access overview](/docs/concepts/temporary-access) covers target setup, connection methods, and credential handling.

OpenRouter targets create a new API key per lease with a spending limit and an
upstream expiration time. The broker deletes the key on manual revocation or
expiry. Existing requests are not cancelled. Create an OpenRouter management
API key with permission to create, list, and delete keys; ordinary inference
keys cannot provision credentials.

In **Dynamic secrets → Add a target**, select **OpenRouter**, set the per-key
spending limit and optional workspace ID, and enter the management credential.
The broker can decrypt the management credential to use it. Issued keys are
wrapped to the requesting browser or CLI's ephemeral key; the API and lease
ledger contain no plaintext credentials.

For CLI setup, save this non-secret configuration as `openrouter.json`:

```json
{"provider":"openrouter","executor":"in_do","creditLimit":10,"maxTtlSeconds":3600}
```

```sh
seekrit dynamic target add --name agent-models --config openrouter.json < /secure/openrouter-management-key
seekrit dynamic lease agent-models --ttl 30m
seekrit dynamic revoke lea_example
```

Lease output is JSON containing `leaseId`, `expiresAt`, and `credential` with
`apiKey`, `keyHash`, and `expiresAt`. Copy it once; it cannot be retrieved later.
`creditLimit` is required, and zero prevents spending. Optional `limitReset`
accepts `daily`, `weekly`, or `monthly`; omission makes it a total limit.
`includeByokInLimit` defaults to true. Optional `workspaceId` scopes key creation
to that workspace. Lifetimes are 1 minute–7 days, clamped to `maxTtlSeconds`.
OpenRouter keys cannot be renewed; create another lease. Failed provisioning
retains a cleanup record, and failed deletion is retried by the broker.

See the [CLI reference](/docs/reference/cli) and [API reference](/docs/reference/api) for commands and endpoints.
