API Overview
The Optropic API provides programmatic access to generate and verify authenticated product codes. All endpoints use REST conventions with JSON request/response bodies.
Base URL
https://api.optropic.com/api/v1
API Versioning
The API version is included in the URL path (/api/v1). We follow semantic versioning:
- v1 — Current stable version
- Breaking changes will increment the major version
- New features are added without version changes
Content Type
All requests must include:
Content-Type: application/json
All responses return:
Content-Type: application/json
Authentication
All API requests require an API key passed in the x-api-key header:
curl -H "x-api-key: optr_live_YOUR_KEY" https://api.optropic.com/api/v1/...
See Authentication for details.
Core Endpoints
| Endpoint | Method | Description |
|---|---|---|
/code/generate | POST | Generate a new authenticated code |
/code/verify | POST | Verify a code's authenticity |
/keys | GET | List your registered public keys |
/keys | POST | Register a new public key |
Response Format
All responses follow this structure:
Success Response
{
"data": { ... },
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-02-18T10:30:00Z"
}
}
Error Response
{
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid or expired",
"details": { ... }
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-02-18T10:30:00Z"
}
}
HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created (for POST requests that create resources) |
400 | Bad Request — Invalid parameters |
401 | Unauthorized — Invalid or missing API key |
404 | Not Found — Resource doesn't exist |
429 | Too Many Requests — Rate limit exceeded |
500 | Internal Server Error |
Rate Limiting
Rate limits are enforced per API key. See Rate Limits for tier details.
Response headers include:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1708257600
SDKs
Official SDKs are coming soon:
- JavaScript/TypeScript —
npm install @optropic/sdk(Q2 2026) - Python —
pip install optropic(Q2 2026)
For now, use the REST API directly with any HTTP client.