وثائق المطورين
واجهة برمجة تطبيقات neo-fashion.ai
Generate product photography, video, and campaign imagery programmatically. The same API the platform uses — available to your integration from day one.
Base URL
All API requests use the following base URL. There is no versioning beyond v1 —
all current endpoints are stable. Breaking changes will be released under v2 with
a minimum 6-month deprecation window.
https://app.neofashion.ai/api/v1 Authentication
The API accepts two authentication strategies on every endpoint. Both resolve to a workspace and user context server-side.
API Key
For server-to-server integrations. Generate API keys in your workspace settings.
Keys are prefixed ne_.
Authorization: Bearer ne_live_xxxxxxxxxxxx JWT (Session)
For web UI sessions. Supabase Auth JWT is accepted on every endpoint — the same path the platform frontend uses.
Authorization: Bearer eyJhbGci...
All requests include a source field (ui or api) and optional
api_key_id for audit and billing purposes.
Core Endpoints
Generation endpoints consume credits from your workspace balance before calling the AI provider. Credits are refunded automatically if the provider returns an error.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/generate/image | Generate a single product photo |
| POST | /api/v1/generate/video | Generate a short fashion video |
| POST | /api/v1/generate/bulk | Async batch generation job |
| POST | /api/v1/sketch-to-photo | Sketch → campaign-quality photo |
| GET | /api/v1/generations | List generations (paginated) |
| GET | /api/v1/generations/:id | Generation detail + status |
| GET | /api/v1/credits/balance | Current credit balance |
| GET | /api/v1/personas | Workspace personas |
| GET | /api/v1/models | Custom trained models |
Response Shape
Every endpoint returns the same envelope. This makes error handling consistent across all operations regardless of the generation type.
Success (200)
{
"data": {
"id": "gen_01hwz...",
"status": "completed",
"output_url": "https://...",
"credits_used": 50
},
"meta": {
"credits_used": 50,
"credits_remaining": 7950,
"request_id": "req_01hwz..."
},
"error": null
} Error (4xx / 5xx)
{
"data": null,
"meta": { "request_id": "req_01hwz..." },
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Credit balance too low for this operation.",
"details": { "required": 50, "available": 20 }
}
} Rate Limits & Plans
Rate limits apply per workspace. Limits reset on a rolling 60-second window.
The current limit is returned in every response via X-RateLimit-Remaining and
X-RateLimit-Reset headers.
| Plan | Rate limit |
|---|---|
| Starter | 60 req / min |
| Pro | 300 req / min |
| Enterprise | Custom SLA |
Error Codes
Structured error codes are always present in the error.code field.
HTTP status codes follow standard REST conventions.
| Code | HTTP | Meaning |
|---|---|---|
INSUFFICIENT_CREDITS | 402 | Workspace credit balance too low for this operation |
UNAUTHORIZED | 401 | Missing or invalid API key / JWT |
FORBIDDEN | 403 | Feature not available on current plan |
NOT_FOUND | 404 | Generation or resource does not exist in this workspace |
RATE_LIMITED | 429 | Request rate exceeds plan limit |
PROVIDER_ERROR | 502 | AI provider returned an error; credits refunded automatically |
Get started
Ready to integrate?
API access is available on Pro and Enterprise plans. Create a workspace and generate your first API key in under two minutes.