The REChain IDE provides a comprehensive RESTful API that allows developers to integrate with the platform programmatically. This documentation covers all available endpoints, authentication methods, and usage examples.
All API requests should be prefixed with the version number:
https://api.rechain.ai/v1/
To access the API, you need an API key which can be generated in your account settings.
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.rechain.ai/v1/projectsFor applications requiring user authorization, we support OAuth 2.0:
- Register your application in the developer portal
- Obtain client credentials
- Implement the OAuth flow
API requests are rate-limited to prevent abuse:
- 1000 requests per hour for authenticated users
- 100 requests per hour for unauthenticated users
- 10,000 requests per hour for enterprise accounts
Exceeding these limits will result in a 429 (Too Many Requests) response.
All API responses follow standard HTTP status codes:
- 200: Success
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 429: Too Many Requests
- 500: Internal Server Error
Error responses include a JSON object with error details:
{
"error": {
"code": "INVALID_REQUEST",
"message": "The request is invalid",
"details": "Project name is required"
}
}Get a list of all projects for the authenticated user.
GET /projects
Parameters:
limit(optional): Number of projects to return (default: 20, max: 100)offset(optional): Offset for pagination
Response:
{
"projects": [
{
"id": "proj_1234567890",
"name": "My Project",
"description": "A sample project",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"language": "javascript",
"status": "active"
}
],
"total": 1,
"limit": 20,
"offset": 0
}Create a new project.
POST /projects
Request Body:
{
"name": "My New Project",
"description": "A description of my project",
"language": "python",
"template": "web-application"
}Response:
{
"id": "proj_0987654321",
"name": "My New Project",
"description": "A description of my project",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"language": "python",
"status": "active",
"repository_url": "https://github.com/user/my-new-project"
}Get details for a specific project.
GET /projects/{project_id}
Response:
{
"id": "proj_1234567890",
"name": "My Project",
"description": "A sample project",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"language": "javascript",
"status": "active",
"repository_url": "https://github.com/user/my-project",
"ai_model": "gpt-4",
"quantum_enabled": true,
"web6_enabled": false
}Update project details.
PUT /projects/{project_id}
Request Body:
{
"name": "Updated Project Name",
"description": "Updated description"
}Delete a project.
DELETE /projects/{project_id}
Get a list of available AI agents.
GET /agents
Response:
{
"agents": [
{
"id": "agent_code_generator",
"name": "Code Generator",
"description": "Generates code from natural language descriptions",
"capabilities": ["code_generation", "refactoring"],
"supported_languages": ["javascript", "python", "go"]
}
]
}Execute an AI agent with specific parameters.
POST /agents/{agent_id}/execute
Request Body:
{
"project_id": "proj_1234567890",
"parameters": {
"prompt": "Create a function that calculates fibonacci numbers",
"language": "python"
}
}Response:
{
"task_id": "task_1234567890",
"status": "processing",
"result": null
}Get the status of an asynchronous task.
GET /tasks/{task_id}
Response:
{
"task_id": "task_1234567890",
"status": "completed",
"result": {
"code": "def fibonacci(n):\n if n <= 1:\n return n\n else:\n return fibonacci(n-1) + fibonacci(n-2)",
"explanation": "This function calculates fibonacci numbers recursively"
},
"created_at": "2026-01-01T00:00:00Z",
"completed_at": "2026-01-01T00:00:05Z"
}Get a list of available quantum algorithms.
GET /quantum/algorithms
Response:
{
"algorithms": [
{
"id": "shor",
"name": "Shor's Algorithm",
"description": "Integer factorization algorithm",
"complexity": "O((log N)^3)",
"applications": ["cryptography"]
}
]
}Execute a quantum algorithm with specific parameters.
POST /quantum/algorithms/{algorithm_id}/execute
Request Body:
{
"parameters": {
"number": 15
},
"simulation": true
}Response:
{
"task_id": "quantum_task_1234567890",
"status": "processing"
}Create a new 3D scene for Web6 applications.
POST /web6/scenes
Request Body:
{
"name": "My 3D Scene",
"description": "A sample 3D scene"
}Response:
{
"scene_id": "scene_1234567890",
"name": "My 3D Scene",
"description": "A sample 3D scene",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}Add a 3D object to a scene.
POST /web6/scenes/{scene_id}/objects
Request Body:
{
"type": "cube",
"position": {
"x": 0,
"y": 0,
"z": 0
},
"rotation": {
"x": 0,
"y": 0,
"z": 0
},
"scale": {
"x": 1,
"y": 1,
"z": 1
}
}Invite a user to collaborate on a project.
POST /projects/{project_id}/invitations
Request Body:
{
"email": "user@example.com",
"role": "editor"
}Get a list of collaborators for a project.
GET /projects/{project_id}/collaborators
Deploy a project to a target environment.
POST /projects/{project_id}/deployments
Request Body:
{
"target": "aws",
"environment": "production",
"configuration": {
"region": "us-west-2",
"instance_type": "t3.micro"
}
}The REChain IDE supports webhooks for real-time notifications about project events.
project.created: A new project was createdproject.updated: A project was updatedproject.deleted: A project was deleteddeployment.completed: A deployment was completedagent.task.completed: An AI agent task was completed
Configure webhooks in your account settings:
{
"url": "https://your-domain.com/webhook",
"events": ["project.created", "deployment.completed"],
"secret": "your-webhook-secret"
}Webhook payloads include event details and a signature for verification:
{
"event": "project.created",
"timestamp": "2026-01-01T00:00:00Z",
"data": {
"project_id": "proj_1234567890",
"name": "My Project"
},
"signature": "sha256=..."
}We provide official SDKs for popular programming languages:
const Rechain = require('@rechain/sdk');
const client = new Rechain({
apiKey: 'YOUR_API_KEY'
});
const projects = await client.projects.list();from rechain import RechainClient
client = RechainClient(api_key='YOUR_API_KEY')
projects = client.projects.list()import "github.com/rechain/sdk-go"
client := sdk.NewClient("YOUR_API_KEY")
projects, err := client.Projects.List()Always check the HTTP status code and handle errors appropriately:
try {
const response = await fetch('https://api.rechain.ai/v1/projects', {
headers: {
'Authorization': `Bearer ${apiKey}`
}
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.message);
}
const data = await response.json();
return data;
} catch (error) {
console.error('API request failed:', error);
}When retrieving lists, implement pagination to handle large datasets:
async function getAllProjects() {
let allProjects = [];
let offset = 0;
const limit = 100;
while (true) {
const response = await fetch(
`https://api.rechain.ai/v1/projects?limit=${limit}&offset=${offset}`,
{
headers: {
'Authorization': `Bearer ${apiKey}`
}
}
);
const data = await response.json();
if (data.projects.length === 0) {
break;
}
allProjects = allProjects.concat(data.projects);
offset += limit;
}
return allProjects;
}Implement exponential backoff for rate limiting:
async function makeRequestWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || (2 ** i);
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
continue;
}
return response;
} catch (error) {
if (i === maxRetries - 1) throw error;
await new Promise(resolve => setTimeout(resolve, 2 ** i * 1000));
}
}
}For API support, please contact our developer support team at developers@rechain.ai or visit our developer portal at https://developers.rechain.ai.