Introduction
L'API CloudForge vous permet d'intégrer la création de projets, le déploiement et l'IA directement dans vos outils et workflows. L'API RESTful utilise JSON pour les requêtes et réponses.
Base URL:
https://api.cloudforge.ai/v1
Authentification
Toutes les requêtes API doivent être authentifiées via un token Bearer dans l'en-tête Authorization ou via les cookies de session. Les tokens API peuvent être générés depuis les paramètres de votre compte.
Authentification Bearer Token
Authorization: Bearer <your-api-token> # Example with curl curl -H "Authorization: Bearer cf_live_abc123..." \ https://api.cloudforge.ai/v1/projects
Authentification par session
// Cookies are set automatically after login
// Include credentials in fetch requests:
fetch('/api/projects', { credentials: 'include' })Projets
GET/api/projectsList projects
POST/api/projectsCreate project
GET/api/projects/{id}Get project
PATCH/api/projects/{id}Update project
DELETE/api/projects/{id}Delete project
GET/api/projects/{id}/filesList files
POST/api/projects/{id}/filesUpsert file
DELETE/api/projects/{id}/files?path=...Delete file
# Create a new project
curl -X POST https://api.cloudforge.ai/v1/projects \
-H "Authorization: Bearer cf_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "My API",
"type": "api",
"framework": "express",
"description": "REST API with auth"
}'Déploiements
GET/api/deployList deployments
POST/api/deployTrigger deployment
GET/api/deploy/{id}Get deployment
DELETE/api/deploy/{id}Cancel deployment
# Trigger a deployment
curl -X POST https://api.cloudforge.ai/v1/deploy \
-H "Authorization: Bearer cf_live_abc123..." \
-H "Content-Type: application/json" \
-d '{ "projectId": "abc123" }'
# Response (202 Accepted)
{
"deploymentId": "dep_xyz",
"status": "pending"
}Intelligence Artificielle
POST/api/ai/chatChat with AI
POST/api/ai/generateGenerate code
POST/api/ai/agentRun agent task
GET/api/ai/modelsList models
Domaines
GET/api/domains/check?domain=...Check availability
POST/api/domains/registerRegister domain
GET/api/domains/registerList registrations
Limites de débit
| Plan | Requêtes/min |
|---|---|
| Free | 60 |
| Pro | 300 |
| Enterprise | 1000 |
Headers de réponse : X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After (si 429).
Codes d'erreur
| Code | HTTP | Description |
|---|---|---|
UNAUTHORIZED | 401 | Token manquant ou invalide |
MFA_REQUIRED | 200 | MFA activé, code TOTP requis |
MFA_INVALID | 401 | Code TOTP ou backup code invalide |
RATE_LIMITED | 429 | Limite de débit dépassée |
ACCOUNT_LOCKED | 423 | Compte verrouillé (brute force) |
DOMAIN_UNAVAILABLE | 409 | Domaine déjà enregistré |
D1_NOT_CONFIGURED | 503 | D1 non initialisé |
{
"error": "Limite de débit dépassée",
"code": "RATE_LIMITED",
"retryAfter": 42
}