Development Guide
This guide helps you integrate our API services into your application.Asynchronous Processing
Our API uses an asynchronous processing model:- Submit a task: send a generation request and receive a task ID
- Poll status: periodically check task status
- Get results: fetch generation results when the task completes
Polling example
Error Handling
Common errors
| Status | Description | Resolution |
|---|---|---|
| 400 | Invalid request parameters | Check request parameters and format |
| 401 | Authentication failed | Verify your API key |
| 402 | Insufficient balance | Top up your account balance |
| 429 | Rate limit exceeded | Reduce request frequency |
| 500 | Server error | Retry later |
Example
Best Practices
- Caching: generated image/video links are valid for 24 hours
- Retries: implement exponential backoff on transient errors
- Monitoring: regularly check API usage and quotas
- Security: keep your API key secure
Support
If you run into issues during development, you can get help via:- Email: zhihong@apimart.ai
- Live chat: visit our website
- Docs: browse the full API documentation