Examples
Endpoints
Chat Completions
Endpoint:
POST /chat/completions
Description: Generate responses based on given prompts.
Example Request in Python and JS
Image Generation
Endpoint: POST /images/generations
Description: Generate images based on given prompts.
Example Request in Python and JS
Speech to Text
Endpoint:
POST api.aimlapi.com/stt
Description: Convert audio files to text.
Text to Speech
Endpoint:
POST api.aimlapi.com/tts
Description: Convert text to audio.
Example Request (JS):
Response Structure
Common Response Fields
id
: Unique identifier for the request.object
: Type of object returned.created
: Timestamp of the request.model
: Model used for the request.choices
: List of completion choices.usage
: Token usage information.
Example Response (Chat Completion):
Last updated