Overview
Constants exposes tools through a REST API for programmatic access, automation, and integration into existing workflows.The Constants API is available for all tools. No additional configuration required.
REST API
Authentication
All API requests require authentication using an API key.Getting Your API Key
- Log in to constants.io
- Click your profile icon in the sidebar
- Select API Keys
- Create a new key for API access
Using Your Key
Include your API key in theAuthorization header:
Base URL
All API endpoints are available at:Tools Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /tools | List all your Tools |
GET | /tools/:id | Get a specific Tool |
POST | /tools | Create a new Tool |
PUT | /tools/:id | Update a Tool |
DELETE | /tools/:id | Delete a Tool |
POST | /tools/:id/run | Execute a Tool |
Runs Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /tools/:id/runs | List runs for a Tool |
GET | /runs/:id | Get a specific run |
GET | /runs/:id/logs | Get run logs |
GET | /runs/:id/artifacts | List run artifacts |
GET | /artifacts/:id | Download an artifact |
Example: Execute a Tool
Example: Get Run Status
Rate Limits
To ensure fair usage, the API has rate limits:| Tier | Requests per minute | Runs per day |
|---|---|---|
| Free | 60 | 100 |
| Pro | 300 | 1,000 |
| Enterprise | Custom | Custom |
429 Too Many Requests response with a Retry-After header.
Error Handling
The API uses standard HTTP status codes:| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request — Invalid parameters |
401 | Unauthorized — Invalid or missing API key |
403 | Forbidden — Insufficient permissions |
404 | Not Found — Resource doesn’t exist |
429 | Too Many Requests — Rate limit exceeded |
500 | Server Error — Something went wrong |
Webhooks
Configure webhooks to receive notifications when events occur:- run.started — A Tool run has begun
- run.completed — A Tool run finished successfully
- run.failed — A Tool run failed
- tool.updated — A Tool’s spec or version changed
SDKs
Official SDKs are coming soon for:- Python —
pip install constants-sdk - JavaScript/TypeScript —
npm install @constants/sdk
In the meantime, you can use any HTTP client to interact with the API.
Advanced: MCP Integration
For AI agent workflows, Constants also supports the Model Context Protocol (MCP) — a standard for AI agents to discover and execute tools.MCP Configuration
MCP Configuration
Need Help?
Join Discord
Get help from the community
Contact Support
Reach out to our team
