Introduction
The MythIQ API provides a unified interface to access various AI models and services through a single endpoint. It simplifies the process of working with different AI providers by handling authentication, routing, and fallbacks automatically.
Our API is designed to be:
- Simple - Easy to use with minimal configuration
- Reliable - Built-in fallbacks and error handling
- Flexible - Works with a wide range of models and providers
- Compatible - Designed to work with existing OpenAI SDKs
- Cost-effective - Intelligent routing to optimize for cost and performance
Unified Access
MythIQ's API provides a single point of access to multiple AI providers, simplifying integration and ensuring reliability through automatic fallbacks and intelligent routing.
Base URL
All API requests should be made to the following base URL:
The API follows RESTful conventions and uses standard HTTP methods and status codes. All requests and responses are in JSON format.
Authentication
The MythIQ API uses API keys for authentication. You should include your API key in theAuthorization
header of all requests:
curl https://api.mythiq.ai/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
For more details on authentication, see the Authentication page.
API Structure
The MythIQ API is organized into several main endpoints:
Media Endpoints
Endpoints for generating and managing media content such as images and videos.
Endpoint | Description |
---|---|
/v1/media | List and search media items |
/v1/images/generations | Generate images using AI models |
/v1/videos/generations | Generate videos using AI models |
/v1/media/upload | Get a signed URL for uploading media files |
/v1/media/:id | Complete a media upload process |
Model Endpoints
Endpoints for retrieving information about available models.
Endpoint | Description |
---|---|
/v1/models | List available models |
/v1/models/:id | Get details about a specific model |
Provider Endpoints
Endpoints for retrieving information about available providers.
Endpoint | Description |
---|---|
/v1/providers | List available providers |
/v1/providers/:id | Get details about a specific provider |
Response Format
All API responses follow a consistent format:
{
// For successful requests
"success": true,
"data": [...], // or "result": {...} for some endpoints
// Additional metadata (when applicable)
"price": 0.002,
"stats": {
"setupTime": 120,
"processingTime": 350,
"generationTime": 2500,
"retries": 0,
"providerId": "stability"
},
// For failed requests
"success": false,
"message": "Error message",
"code": "error_code"
}
The specific structure of the data
orresult
field depends on the endpoint. Refer to the documentation for each endpoint for details.
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of a request. In addition, error responses include a JSON body with more details:
{
"success": false,
"message": "Invalid API key",
"code": "authentication_error"
}
For a complete list of error codes and their meanings, see the Errors documentation.
Rate Limits
The API enforces rate limits to ensure fair usage and system stability. The specific limits depend on your account tier. When you exceed a rate limit, the API will return a 429 Too Many Requests status code.
Rate limit information is included in the response headers:
For more details on rate limits, see the Limits documentation.
SDK Compatibility
The MythIQ API is designed to be compatible with existing OpenAI SDKs. You can use the official OpenAI SDK for your preferred language by simply changing the base URL:
JavaScript/TypeScript
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://api.mythiq.ai/v1',
apiKey: 'YOUR_API_KEY',
});
// Use the SDK as you normally would
const response = await openai.images.generate({
model: 'stability/sdxl',
prompt: 'A beautiful sunset over the ocean',
});
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.mythiq.ai/v1",
api_key="YOUR_API_KEY"
)
# Use the SDK as you normally would
response = client.images.generate(
model="stability/sdxl",
prompt="A beautiful sunset over the ocean"
)
Next Steps
Now that you have an overview of the API, you can explore the following resources to learn more:
- Authentication - Learn how to authenticate your API requests
- Parameters - Understand the common parameters used across the API
- Images - Generate and manage images using AI models
- Videos - Generate and manage videos using AI models
- Models - Explore the available AI models