Get your API key
Generate an API key on our API page.Add Balance
If you haven’t deposited yet, add some funds to your balance. Minimum deposit is just $1, or $0.10 when using crypto.API usage examples
Text Generation
Text Generation
Here’s a simple example using our OpenAI-compatible chat completions endpoint:Use
Routing preferences
For supported open-source models, you can request routing preferences with model suffixes::fast for fastest estimated completion, :cheap for lowest provider price, and :caching to require a cache-capable provider. These are pay-as-you-go provider-selection requests. See Model Suffixes for the full list.For more detailed examples and other text generation endpoints, check out our Text Generation Guide.Image Generation
Image Generation
OpenAI-Compatible Endpoint (v1/images/generations)
You can also generate images using our OpenAI-compatible endpoint:Video Generation
Video Generation
Submit a video generation job, then poll the status endpoint until the video is ready:For more detailed examples and model-specific options, check out our Video Generation Guide.