Skip to main content
Creates an API key and returns its full value once. Pass member_principal_id to issue the key for a VIRTUAL member (the key then acts as that member); human members cannot be targeted.
Permission required: service_account:create (all keys)
  • When you set member_principal_id: member:manage_virtual
  • Changes that give someone an admin role, or that reduce what an admin can reach, also require the team owner or an admin.

Headers

string
Optional. Retrying with the same value replays the first result instead of creating a second key.

Request Body

string
required
Display name for the key
array
Optional. Client IPs or CIDR ranges (e.g. 10.0.0.1, 192.168.0.0/16) this key may be used from. Omit or send [] for no restriction.
string
Optional. Fallback model-routing group, same rule as group.
integer
Expiry, Unix seconds. Omit or send 0 for a key that never expires.
string
Optional. Model-routing group. Must be a public group or the owner’s own group.
string
Optional. Issue the key for this VIRTUAL member (from POST /members); the key acts as that member. Human members cannot be targeted.

Response

object

Errors

Errors answer with success: false, a message and an error_code. See Error Codes for every code.