Clavis API Reference

Base URL: https://clavisagent.com/v1/ — Bearer token authentication required on all protected endpoints.

Quick Start

Five steps from zero to a running agent with managed credentials:

  1. Install the SDK: pip install clavis
  2. Register: POST /v1/auth/register with email + password
  3. Log in: POST /v1/auth/login → receive a JWT (24-hour expiry)
  4. Register a service: POST /v1/services with a connector name (e.g. openai)
  5. Store credentials: POST /v1/services/{service_id}/credentials with your API key or OAuth token

After that, call get_token() or proxy() from the SDK — Clavis handles token refresh and rate limiting automatically.

from clavis import ClavisClient

client = ClavisClient(api_key="eyJ...", base_url="https://clavisagent.com")

# Get a valid token — refreshed automatically if expired
token = await client.get_token("my-openai")
print(token.access_token)  # sk-...

# Or proxy a full request — auth injected, rate limits tracked
response = await client.proxy(
    "my-openai", "POST", "/v1/chat/completions",
    body={"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]},
)

Authentication

All protected endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <your-jwt-token>

Tokens are obtained by logging in via POST /v1/auth/login and expire after 24 hours. There is no API key separate from the JWT — your login token is your API key.

Key Endpoints

MethodPathDescription
POST/v1/auth/registerRegister a developer account
POST/v1/auth/loginLog in and receive a JWT
GET/v1/servicesList all registered services
POST/v1/servicesRegister a new service with a connector
GET/v1/services/{service_id}Get details for a specific service
POST/v1/services/{service_id}/credentialsStore an API key or OAuth token for a service
GET/v1/services/{service_id}/credentialsCheck credential status (never returns raw secrets)
POST/v1/tokens/{service_id}Retrieve a valid token — auto-refreshed if expired
POST/v1/proxy/{service_id}Proxy a full HTTP request with auth injected
GET/v1/billing/planCurrent plan and usage counters

Additional Endpoints

The following endpoints are also available. For full request/response schemas, use the Interactive Explorer below or fetch /openapi.json directly.

MethodPathDescription
POST/v1/call/{service_name}Call a service by name (resolves service ID automatically)
GET/v1/credentials/{name}/checkCheck whether credentials for a service are present and valid
POST/v1/credentials/{name}/verifyActively verify credentials against the upstream service
POST/v1/credentials/{name}/headersGet auth headers for a service (for manual HTTP requests)
POST/v1/credentials/{name}/ws_headersGet auth headers for WebSocket connections
GET/v1/credentials/summarySummary of all stored credentials across services
POST/v1/auth/logoutInvalidate the current JWT
POST/v1/auth/request-resetRequest a password reset email
POST/v1/auth/reset-passwordComplete a password reset with a token
GET/v1/auth/me/billingCurrent account billing status and plan details

Supported Connectors

Pass one of these as connector_name when registering a service:

openai anthropic github stripe brave kalshi coinbase alpaca kalshi-rsa coinbase-jwt api-key

The api-key connector is a generic fallback for any service that accepts a static API key in an Authorization: Bearer header.

Error Codes

All error responses return JSON: {"detail": "human-readable message"}

StatusMeaning
401Missing or expired JWT
403Valid JWT but insufficient permissions
404Service or credential not found
422Validation error — check request body fields
429Rate limit exceeded for this service
402Plan usage limit reached — upgrade to continue

Interactive API Explorer

Try live requests below. Click Authorize and paste your JWT to authenticate.