Skip to main content
POST
Add a shared key
Takes a signed-in session only. A managing key is refused with 403. See Editions for what OneCLI Cloud adds. Adds an API key or an LLM key to this organization’s shared items. It is shared with no vault, so no agent can use it yet. The answer never carries the value. For an admin or the owner, signed in and not using a key.
Availability: OneCLI Cloud only. A self-hosted deployment does not serve this endpoint and answers 404 with error.code: "not_found".

Authorizations

Authorization
string
header
required

A managing key (oc_key_...), an older API key (oc_...), or a signed-in session.

Headers

Idempotency-Key
string

Optional. 1 to 255 visible characters. A retry with the same key, path and body returns the first answer (with Idempotent-Replayed: true) for 24 hours. The same key with another path or body is 422 idempotency_conflict.

Required string length: 1 - 255

Body

application/json
hostPattern
string
required
Required string length: 1 - 1000
kind
enum<string>
required
Available options:
api_key
name
string
required
Required string length: 1 - 255
value
string
required

The key itself. Stored encrypted. No answer ever carries it back.

Required string length: 1 - 10000
injectionConfig
object
pathPattern
string
Maximum string length: 1000

Response

The new item.

createdAt
string
required

ISO 8601.

hosts
string[]
required

The hosts the gateway uses this item for.

id
string
required
kind
enum<string>
required
Available options:
app,
api_key,
llm_key
name
string
required
service
string | null
required

The app or LLM provider, for example github or anthropic. null for a plain API key.

sharedWith
object
required
state
enum<string>
required

ready, reauth_required (the app must be signed in again) or disconnected.

Available options:
ready,
reauth_required,
disconnected