API Keys

Manage API keys for your Skirre account. Create admin keys for server-side operations and search keys for client-side search.

POST /v1/keys Admin key

Create a new API key. The full key is returned only once, so store it immediately.

Request body

ParameterTypeDescription
name requiredstringHuman-readable name for the key.
key_type optionalstring"admin" for full access or "search" for read-only search access.
Default: "search"
allowed_origins optionalstringJSON array string of allowed CORS origins (e.g. '["https://example.com"]'). Null for no restriction.

Example

text
curl -X POST https://search.example.com/v1/keys \
  -H "Authorization: Bearer sk_search_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Frontend",
    "key_type": "search",
    "allowed_origins": "["https://example.com"]"
  }'

SDK

text
const key = await skirre.createKey({
  name: 'Production Frontend',
  key_type: 'search',
  allowed_origins: '["https://example.com"]',
});
console.log(key.key); // Full key - store securely, shown only once

Response 201 Created

text
{
  "key": "pk_search_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
  "id": "key_abcd1234efgh5678",
  "name": "Production Frontend",
  "prefix": "pk_search_live_aBcDeFgHi...",
  "key_type": "search",
  "created_at": "2026-01-15T10:30:00Z"
}
Store the key immediately
The key field contains the full plaintext API key. Skirre only stores a SHA-256 hash, so the full key cannot be retrieved later.
GET /v1/keys Admin key

List all API keys for the authenticated account. Full key values are never returned.

Example

text
curl https://search.example.com/v1/keys \
  -H "Authorization: Bearer sk_search_live_..."

SDK

text
const keys = await skirre.listKeys();

Response 200 OK

text
{
  "data": [
    {
      "id": "key_abcd1234efgh5678",
      "name": "Production Frontend",
      "prefix": "pk_search_live_aBcDeFgHi...",
      "key_type": "search",
      "allowed_origins": "["https://example.com"]",
      "rate_limit_per_minute": 1000,
      "created_at": "2026-01-15T10:30:00Z",
      "last_used_at": "2026-01-15T11:45:00Z",
      "revoked_at": null
    }
  ]
}
DELETE /v1/keys/{key_id} Admin key

Revoke an API key. The key is marked as revoked and can no longer be used.

Path parameters

ParameterTypeDescription
key_id requiredstringThe key ID (not the key itself).

SDK

text
await skirre.revokeKey('key_abcd1234efgh5678');

Response 204 No Content


The key object

ParameterTypeDescription
id requiredstringUnique key identifier.
name requiredstringHuman-readable name.
prefix requiredstringFirst characters of the key for identification (e.g. "pk_search_live_aBcDeFgHi...").
key_type requiredstring"admin" or "search".
allowed_origins optionalstring | nullJSON array of allowed CORS origins, or null.
rate_limit_per_minute requirednumberMaximum requests per minute for this key.
created_at requiredstringISO 8601 creation timestamp.
last_used_at optionalstring | nullISO 8601 timestamp of last use, or null.
revoked_at optionalstring | nullISO 8601 revocation timestamp, or null if active.