Aex Brain
Build an application

Models

Choose a model and connect your provider account.

Bring your own provider key and pick a model when you create the session. The provider bills usage to that key. This fragment comes from the quickstart, which checks OPENAI_API_KEY before assigning it to apiKey:

model: {
  provider: "openai",
  name: "gpt-5-mini",
  apiKey,
},

Keep the key in your server environment. A session keeps its model for life; create a new session to switch models.

Choose a provider

ProviderproviderModel name
OpenAIopenaiFor example, gpt-5-mini
AnthropicanthropicThe model ID from your provider
Vercel AI Gatewayvercel-ai-gatewayProvider-prefixed, such as openai/gpt-5-mini
DeepSeekdeepseekThe model ID from your provider

Call await brain.models() to list models and their known capabilities, or await brain.models("openai") for a single provider. What's available, and which inputs each model accepts, depends on the provider and your account.

Send images and PDFs

Pick a model that supports the input, then pass a reachable HTTPS URL:

await session.send({
  message: "Describe this image.",
  media: [{ type: "image", url: "https://your-app.example/image.png" }],
});

Use your own file URL and keep it reachable for as long as the conversation needs it. Standalone Brain doesn't host files; see the Aex docs for hosted uploads.

Model compatibility covers PDF formats, provider protocols and exact request behavior.

On this page