Aller au contenu principal

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

PlanRequêtes/min
Free60
Pro300
Enterprise1000

Headers de réponse : X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After (si 429).

Codes d'erreur

CodeHTTPDescription
UNAUTHORIZED401Token manquant ou invalide
MFA_REQUIRED200MFA activé, code TOTP requis
MFA_INVALID401Code TOTP ou backup code invalide
RATE_LIMITED429Limite de débit dépassée
ACCOUNT_LOCKED423Compte verrouillé (brute force)
DOMAIN_UNAVAILABLE409Domaine déjà enregistré
D1_NOT_CONFIGURED503D1 non initialisé
{
  "error": "Limite de débit dépassée",
  "code": "RATE_LIMITED",
  "retryAfter": 42
}