API Documentation

CodeCopyPro provides a RESTful API that allows you to integrate our AI-powered code generation capabilities into your own applications.

Authentication

All API requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Rate Limits

Rate limits vary by plan:

  • Free: 50 requests per month
  • Pro: 1,000 requests per month
  • Enterprise: Custom limits

Endpoints

Generate Prompt

POST/api/v1/generate

Generate a code prompt from an image

Request

curl -X POST https://api.codecopypro.com/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "focus=web"

Response

{
  "success": true,
  "prompt": "Create a modern landing page with...",
  "tokens_used": 150,
  "remaining_credits": 850
}

Get Account

GET/api/v1/account

Get your account information and usage statistics

Request

curl https://api.codecopypro.com/v1/account \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "account": {
    "id": "acc_123",
    "email": "[email protected]",
    "plan": "pro",
    "credits_used": 150,
    "credits_remaining": 850
  }
}

Error Handling

The API uses conventional HTTP response codes to indicate the success or failure of an API request:

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 429: Too Many Requests
  • 500: Internal Server Error

Need Help?

If you need help with the API or have any questions, please check our support page or contact our developer support team.