đźš§ SanctumAI is in beta. APIs may change before v1.0.
API ReferenceCredentials

Credentials API

List Credentials

GET /api/v1/credentials

Returns metadata for all credentials (values are never returned in list responses).

Query Parameters:

ParamDescription
typeFilter by credential type

Response:

{
  "data": [
    {
      "path": "openai/api_key",
      "type": "api_key",
      "description": "OpenAI production key",
      "created_at": "2026-02-10T23:15:00Z",
      "updated_at": "2026-02-10T23:15:00Z",
      "access_count": 42
    }
  ]
}

Get Credential

GET /api/v1/credentials/:path

Retrieve a credential value. Creates a lease with TTL based on the applicable policy.

Response:

{
  "data": {
    "path": "openai/api_key",
    "value": "sk-proj-abc123...",
    "lease_id": "lease_abc123",
    "expires_at": "2026-02-14T22:35:00Z"
  }
}

Errors:

CodeStatusDescription
NOT_FOUND404Credential does not exist
ACCESS_DENIED403No policy grants access

Store Credential

POST /api/v1/credentials

Body:

{
  "path": "openai/api_key",
  "type": "api_key",
  "value": "sk-proj-abc123...",
  "description": "OpenAI production key"
}

Response: 201 Created

{
  "data": {
    "path": "openai/api_key",
    "type": "api_key",
    "created_at": "2026-02-14T22:30:00Z"
  }
}

Delete Credential

DELETE /api/v1/credentials/:path

Response: 204 No Content