API Key Format
Keys follow this format:- Prefix:
xq_ - Body: 64 hexadecimal characters
- Storage: Hashed in database (raw key never stored)
Using your API key
Pass the key in thex-api-key header:
Auth methods by endpoint
Most endpoints support dual authentication: either an API key or a session cookie from the dashboard.| Endpoint | API Key | Session Cookie |
|---|---|---|
GET /account | Yes | No |
PATCH /account | Yes | Yes |
POST /api-keys | No | Yes |
GET /api-keys | No | Yes |
DELETE /api-keys/:id | No | Yes |
* /monitors/* | Yes | Yes |
GET /events/* | Yes | Yes |
* /webhooks/* | Yes | Yes |
GET /webhooks/:id/deliveries | Yes | Yes |
* /draws/* | Yes | Yes |
* /extractions/* | Yes | Yes |
* /x/* | Yes | Yes |
POST /x/media/download | Yes | Yes |
GET /trends | Yes | Yes |
PUT /account/x-identity | Yes | Yes |
* /styles/* | Yes | Yes |
* /drafts/* | Yes | Yes |
POST /compose | Yes | Yes |
GET /radar | Yes | Yes |
POST /subscribe | Yes | Yes |
* /integrations/* | Yes | Yes |
* /x-accounts/* | Yes | Yes |
* /x-write/* | Yes | Yes |
* /support/* | Yes | Yes |
API key management endpoints (
/api-keys) require session authentication to prevent key self-management loops.The MCP server also supports OAuth 2.1 with PKCE for browser-based clients (Claude.ai, ChatGPT Developer Mode). See OAuth 2.1 for the complete flow.
Machine Payments Protocol
16 X-API read-only endpoints also accept MPP payments instead of API key authentication. When you call an eligible endpoint without an API key or session cookie, the server returns a 402 payment challenge.Challenge header
| Parameter | Description |
|---|---|
id | Unique challenge identifier |
realm | Protection space (xquik.com) |
method | Payment method (tempo) |
intent | Payment intent (charge or session) |
request | Base64url-encoded JSON with amount, currency, and recipient |
Credential header
After completing the payment, retry the request with a payment credential:Receipt header
Successful responses include a receipt:Eligible endpoints
See the MPP overview for the full list of 16 endpoints, pricing, and intent types.MPP only applies to X-API read-only endpoints. All other endpoints require an API key or session cookie.
Key management
Create a Key
Generate keys from the API Keys page in your dashboard or via the API (session auth only):Create API Key
fullKey) is returned once in the creation response. Store it securely.
Revoke a Key
Revoke API Key
Error response
Invalid or missing API key returns:401 Unauthorized
Security best practices
Store keys in environment variables
Store keys in environment variables
Never hardcode API keys in your source code. Use environment variables to keep keys separate from your codebase:Access the key in your application:
.env
Never commit keys to version control
Never commit keys to version control
Add If a key is accidentally committed, revoke it immediately from your dashboard and generate a new one. Consider the exposed key compromised even if you force-push to remove it from history.
.env to your .gitignore to prevent accidental commits:.gitignore
Rotate keys regularly
Rotate keys regularly
Rotate API keys periodically to limit the impact of a potential leak:
- Create a new key from the dashboard
- Update the key in all your environments
- Verify all services work with the new key
- Revoke the old key
Use separate keys for development & production
Use separate keys for development & production
Create distinct API keys for each environment. This limits blast radius if a development key is compromised and makes it easier to track usage per environment:Name your keys descriptively (e.g., “Production - Backend”, “Staging”, “Local Dev”) so you can identify them in the dashboard.
.env.local
.env.production
Next steps: Quickstart for a complete setup walkthrough, or OAuth Overview for OAuth 2.1 integration.