Skip to main content

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

EndpointMethodDescription
/code/generatePOSTGenerate a new authenticated code
/code/verifyPOSTVerify a code's authenticity
/keysGETList your registered public keys
/keysPOSTRegister 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

CodeMeaning
200Success
201Created (for POST requests that create resources)
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing API key
404Not Found — Resource doesn't exist
429Too Many Requests — Rate limit exceeded
500Internal 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/TypeScriptnpm install @optropic/sdk (Q2 2026)
  • Pythonpip install optropic (Q2 2026)

For now, use the REST API directly with any HTTP client.