canonical: https://jentic.com/apis/aimlapi.com/aiml-api

# AI/ML API

Jentic publishes the only available OpenAPI specification for AI/ML API, keeping it validated and agent-ready. AI/ML API is a unified inference platform that exposes chat completions, completions, embeddings, image generation, audio transcription, and text-to-speech behind a single Bearer-authenticated REST surface modelled on OpenAI conventions. The /v1/models endpoint lists supported models so a client can switch backends without changing integration code.

## For AI agents

Run chat completions, text completions, embeddings, image generation, audio transcription, and text-to-speech through one OpenAI-style endpoint set, and list supported models.

## Scope

Does not handle model fine-tuning, training, or hosted vector storage - use for inference across chat, embeddings, image, and audio only.

## Capabilities

- Generate chat completions for any supported model via POST /v1/chat/completions
- Run plain text completions with /v1/completions for prompt-based generation
- Create embedding vectors for retrieval and semantic search through /v1/embeddings
- Generate images from a text prompt via /v1/images/generations
- Transcribe audio to text using /v1/audio/transcriptions
- Synthesize speech from text via /v1/audio/speech
- Discover available models programmatically with GET /v1/models

## Use cases

### Multi-Model Chat Backend

Power a chat product where users can switch between different LLMs without changing the application code. Call /v1/chat/completions with the desired model and use /v1/models to populate a model selector. Switching providers becomes a config change rather than a refactor.

Example prompt: GET /v1/models to enumerate available models, then POST /v1/chat/completions with the model id chosen by the user

### RAG Pipeline with Hosted Embeddings

Build a retrieval-augmented chatbot that produces embeddings on AI/ML API. Generate vectors with /v1/embeddings, store them in a vector database, and use /v1/chat/completions for the final answer. The single Bearer credential covers both calls.

Example prompt: POST each document chunk to /v1/embeddings, store the vectors, retrieve nearest neighbours at query time, then POST /v1/chat/completions with the retrieved context

### Voice In, Voice Out Assistant

Implement a voice assistant that listens, reasons, and replies in audio. Use /v1/audio/transcriptions to turn speech into text, /v1/chat/completions to generate a reply, and /v1/audio/speech to produce the audio response. The whole loop sits behind one API key.

Example prompt: POST audio to /v1/audio/transcriptions, send the text to /v1/chat/completions, then POST the reply to /v1/audio/speech

### Image Generation from Marketing Copy

Generate hero images directly from marketing copy by passing the brief to /v1/images/generations. The single endpoint returns image URLs that can be used in landing-page generators or design tooling without managing a separate image generation provider.

Example prompt: POST /v1/images/generations with the marketing brief as the prompt and link the returned URL on the page

### Agent-Driven Multi-Modal Pipeline via Jentic

An AI agent decides at runtime whether to call chat, embeddings, image, or audio endpoints. Through Jentic the agent searches for the right operation, the AI/ML API Bearer token is supplied from the vault, and the agent never sees the raw token.

Example prompt: Use Jentic search 'generate a chat completion', execute /v1/chat/completions, and chain /v1/embeddings if retrieval is needed

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/chat/completions | Generate a chat completion |
| POST | /v1/completions | Generate a text completion |
| POST | /v1/embeddings | Create embedding vectors |
| POST | /v1/images/generations | Generate an image from a text prompt |
| POST | /v1/audio/transcriptions | Transcribe audio to text |
| POST | /v1/audio/speech | Synthesize speech from text |
| GET | /v1/models | List available models |

## Key resources

- **Chat Completions** — OpenAI-style chat endpoint at /v1/chat/completions
- **Completions** — Plain text completion endpoint at /v1/completions
- **Embeddings** — Vector embeddings for retrieval and semantic search
- **Images** — Text-to-image generation at /v1/images/generations
- **Audio** — Speech transcription and text-to-speech endpoints
- **Models** — Listing of supported models for runtime selection

## Why Jentic

- **Setup:** Wiring AI/ML API by hand means handling its bearer token, matching each request to the right chat, embedding, image, or audio endpoint, and writing your own retry logic. Through Jentic you install once, import AI/ML API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** AI/ML API carries its model and inputs in the request body, so scope your agent by operation: limit it to the operations it needs, such as /v1/chat/completions or /v1/embeddings, and leave out image or audio endpoints it does not use.
- **Credential handling:** Your AI/ML API bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate a chat completion', and Jentic returns the AI/ML API /v1/chat/completions operation with its messages and model schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenAI API** — OpenAI's first-party LLM, embedding, image, and audio APIs
- **Anthropic Messages API** — First-party Claude messages API
- **Cohere API** — Hosted LLM platform with strong embeddings and reranker models

## FAQ

### Why is there no official OpenAPI spec for AI/ML API?

AI/ML API does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call the AI/ML API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the AI/ML API use?

HTTP Bearer authentication. The Bearer token is sent in the Authorization header. Through Jentic the token is held in the vault and never enters the agent's context.

### Can I run chat completions with multiple models?

Yes. POST /v1/chat/completions with the model id you want to use. Call GET /v1/models to discover which model identifiers are currently supported.

### What are the rate limits for the AI/ML API?

The OpenAPI spec does not declare explicit rate limits. As with most LLM gateways, treat HTTP 429 responses as a signal to back off, and watch for per-model concurrency hints in the response body.

### How do I generate embeddings through Jentic?

Run pip install jentic, search 'create text embeddings', and execute /v1/embeddings with your input strings. The response returns vectors ready to store in a vector database. Run it through Jentic One, the self-hosted execution layer.

### Does the API cover both image generation and audio?

Yes. /v1/images/generations produces images from text prompts, /v1/audio/transcriptions converts audio to text, and /v1/audio/speech synthesises speech from text - all behind the same Bearer token.

### Can I limit what my agent is allowed to do with the AI/ML API?

Yes. Because AI/ML API carries the model and inputs in the request body rather than in separate scopes, you scope the agent by operation in your own self-hosted Jentic One instance, where your rules decide which endpoints and credentials it may use. For example, you can allow only /v1/chat/completions and /v1/embeddings while leaving out /v1/images/generations, /v1/audio/transcriptions, and /v1/audio/speech that the agent does not need. The single stored bearer token is injected at execution time for the operations you permit, so the agent never sees the raw credential.
