Skip to content

Latest commit

 

History

History
101 lines (80 loc) · 2.18 KB

File metadata and controls

101 lines (80 loc) · 2.18 KB

API Overview

Base URL

Development: http://localhost:8000/v1
Production: https://api.example.com/v1

Authentication

API key authentication (optional):

curl -H "X-API-Key: your_key" http://localhost:8000/v1/generate

Response Format

All responses are JSON with the following structure:

Success Response

{
  "field": "value"
}

Error Response

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Description",
    "details": {}
  }
}

HTTP Status Codes

Code Description
200 Success
201 Created
202 Accepted (async)
204 No Content (deleted)
400 Bad Request
404 Not Found
422 Validation Error
429 Rate Limited
500 Server Error

Rate Limiting

  • Limit: 100 requests per 60 seconds
  • Headers: X-RateLimit-Limit, X-RateLimit-Remaining

Endpoints Summary

Generation

Method Endpoint Description
POST /v1/generate Create generation request
GET /v1/requests/{id} Get request status
GET /v1/requests/{id}/download Download sprite sheet

Projects

Method Endpoint Description
POST /v1/projects Create project
GET /v1/projects List projects
GET /v1/projects/{id} Get project
PATCH /v1/projects/{id} Update project
DELETE /v1/projects/{id} Delete project

Assets

Method Endpoint Description
POST /v1/projects/{id}/assets Create asset
GET /v1/projects/{id}/assets List project assets
GET /v1/assets List all assets
GET /v1/assets/{id} Get asset
DELETE /v1/assets/{id} Delete asset
GET /v1/assets/{id}/download Download sprite sheet

Health

Method Endpoint Description
GET /v1/health Health check
GET / API info

Interactive Documentation

  • Swagger UI: /docs
  • ReDoc: /redoc
  • OpenAPI JSON: /openapi.json

Related