MythIQBETA

Command Palette

Search for a command to run...

API Overview

Get started with the MythIQ API and learn about its core concepts and capabilities.

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:

https://api.mythiq.ai/v1

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:

bash
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.

EndpointDescription
/v1/mediaList and search media items
/v1/images/generationsGenerate images using AI models
/v1/videos/generationsGenerate videos using AI models
/v1/media/uploadGet a signed URL for uploading media files
/v1/media/:idComplete a media upload process

For more details, see the Images and Videos documentation.

Model Endpoints

Endpoints for retrieving information about available models.

EndpointDescription
/v1/modelsList available models
/v1/models/:idGet details about a specific model

Provider Endpoints

Endpoints for retrieving information about available providers.

EndpointDescription
/v1/providersList available providers
/v1/providers/:idGet details about a specific provider

Response Format

All API responses follow a consistent format:

json
{
  // 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:

json
{
  "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:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1616979600

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

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

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
API Overview