API reference
Introduction
Base URLs, authentication, request conventions, and error responses. Review Diffio API behavior, response fields, setup details, and production workflows.
Use this reference to plan Diffio API requests and responses. All endpoints use JSON over HTTPS at https://api.diffio.ai/v1.
API reference essentials
- 1
Base URL
Use the production base URL for all API requests.
https://api.diffio.ai/v1Append the endpoint path to the base URL when calling the REST API directly.
- 2
Authentication
Send the API key on every request using one of the supported headers.
Authorization: Bearer <apiKey>X-Api-Key: <apiKey>Xi-Api-Key: <apiKey>
Use API keys with read and write permissions that match the endpoint.
- 3
Request conventions
- All
/v1endpoints usePOSTwith JSON bodies. OPTIONSis accepted for CORS preflight.- Send
Content-Type: application/jsonfor JSON payloads. - Request fields use camelCase, for example
apiProjectId. create_projectreturnsuploadUrlanduploadMethod. Use the returned method and setContent-Typeto matchcontentType.- Download URLs from
get_generation_downloadare signed and expire after about two hours.
- All
- 4
Error responses
Errors return JSON with an
errormessage. Some errors include additional fields such ascodeor billing metadata.Example error response{ "error": "Payment failed. Update your payment method in the billing portal.", "code": "paymentFailed"}Billing holds return
402Payment required, billing issue such as paymentFailed. API usage can be blocked until billing is updated. with codepaymentFailed. API usage can be blocked until billing is updated. Spend limit errors usespendLimitExceeded. - 5
Rate limits
Rate limits and spend limits depend on your plan and API key settings. Review the API pricing page for current limits and use the developer dashboard to monitor usage.
Endpoints
Use these endpoints to create projects, run generations, manage keys, read usage, and configure webhooks.
Projects
Generations
Diffio 2.0 generation
/v1/diffio-2.0-generation
Queue a generation using the diffio-2 model.
Diffio 3.5 generation
/v1/diffio-3.5-generation
Queue a generation using the diffio-3.5 model.
Get generation progress
/v1/get_generation_progress
Fetch progress and job stages for a generation.
Get generation download
/v1/get_generation_download
Return a signed download URL for a generation output.
List project generations
/v1/list_project_generations
List generations for a project.
