Models API (Pro)¶
Let coding agents and OpenAI-compatible apps use your site's AI models with one key. Requests go through your site, so provider keys stay on the server. Your limits apply, and usage shows in Insights.
Turn it on¶
- Open OG AI Core > System > Modules and switch on Models API (in the MCP and agents group). It is off by default and needs OG AI Core Pro.
- In the same block, press Generate to create a key, or paste your own. An empty key turns the API off.
- How to use shows the setup for your app, and Before you use it explains the risks.
Use it¶
- Base address:
https://your-site.example/wp-json/ogaie-openai/v1 - Key: send it as
Authorization: Bearer <key>.
| Method | Route | What it does |
|---|---|---|
| GET | /models |
Lists every chat model of your supported environments. |
| POST | /chat/completions |
OpenAI-style chat, with streaming and tool calls. |
| POST | /responses |
OpenAI Responses API. Works for OpenAI environments only. |
Model IDs are written as <environment>/<model>, where the first part is the environment name in lower case with dashes. That keeps the same model in two environments (for example OpenAI and OpenRouter) apart. Ask /models for the exact list.
Supported environment types: OpenAI, Anthropic, Google, OpenRouter, Mistral, xAI, Perplexity, OVH and Custom (OpenAI-compatible). Requests are passed to each provider's own OpenAI-compatible endpoint, so tool calls and streaming work as your app sends them.
Errors you may see¶
- 401: the key is missing or wrong.
- 404
model_not_found: the model is not on this site. Check/models. - 429
insufficient_quota: the site reached its spending limit in Knowledge > Insights.
Safety¶
- There is one key for the whole site. Keep it private. If it leaks, generate a new one: the old key stops working.
- Requests run as the site administrator, so they count in Insights and in your limits.
- Set limits so a runaway app cannot spend your budget.