Complete reference for all MCPCodex REST API endpoints
https://api.mcpcodex.com
All endpoints are prefixed with the base URL above.
Most endpoints require authentication using a Bearer token in the Authorization header:
Authorization: Bearer your_access_token
/api/v1/auth/login
Authenticate user and get access token
curl -X POST https://api.mcpcodex.com/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "password123"}'
/api/v1/auth/refresh
Refresh access token
curl -X POST https://api.mcpcodex.com/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token": "your_refresh_token"}'
/api/v1/generate
Generate code using AI
curl -X POST https://api.mcpcodex.com/v1/generate \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Create a user authentication function",
"language": "typescript",
"model": "claude-3-opus",
"context": {
"framework": "express",
"database": "postgresql"
}
}'
/api/v1/agents/create
Create a multi-agent workflow
curl -X POST https://api.mcpcodex.com/v1/agents/create \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Code Review Pipeline",
"agents": [
{"type": "analyzer", "model": "gpt-4"},
{"type": "reviewer", "model": "claude-3"}
]
}'
/api/v1/projects
List user projects
curl -X GET "https://api.mcpcodex.com/v1/projects?page=1&limit=10" \
-H "Authorization: Bearer your_token"
/api/v1/projects
Create new project
curl -X POST https://api.mcpcodex.com/v1/projects \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "My API Project",
"description": "REST API with authentication",
"template": "express-typescript"
}'
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
"user": {
"id": 12345,
"email": "[email protected]",
"name": "John Doe",
"plan": "pro"
},
"expires_in": 3600
}
{
"id": "gen_abc123",
"code": "export async function authenticateUser(email: string, password: string) {\n // Generated code here\n}",
"language": "typescript",
"model": "claude-3-opus",
"tokens_used": 250,
"processing_time": 1.2
}