Getting started
This guide walks you from browsing the catalog to a working chat completion.
1. List available models
Section titled “1. List available models”The catalog is public — no API key is required. Use it to discover
model identifiers you will pass as the model field later.
curl https://api.ai.wpengine.com/v1/modelsTruncated response:
{ "object": "list", "data": [ { "id": "google/gemini-3.5-flash", "object": "model", "owned_by": "google", "provider": "google", "display_name": "Gemini 3.5 Flash", "context_window": 1000000, "pricing": { "input_per_million": "1.5", "output_per_million": "9", "currency": "USD" } } ]}Pick a model id from the response — you will pass it as the model
field when you make a chat completion.
2. Create an API key
Section titled “2. Create an API key”API keys are issued against a project — a Power console-managed workspace that owns its own keys, model access, and usage quotas. If you don’t have one yet, create it from the Power console’s project picker before continuing.
- Sign in to the Power console.
- Open the project you want to issue the key against.
- Go to API keys → Create key.
- Copy the key value. It’s shown once — store it in a secret
manager. The key has the form
wpe_<secret>.
API keys are project-scoped and carry a permission preset (all,
read_only, or restricted). For this guide, a key with all — or
one that grants chat:write — is enough.
Store the secret immediately
The Power console never re-displays the secret. If you lose it, rotate the key and update your clients.
3. Make a chat completion
Section titled “3. Make a chat completion”curl https://api.ai.wpengine.com/v1/chat/completions \ -H "Authorization: Bearer wpe_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-3.5-flash", "messages": [ {"role": "system", "content": "You are concise."}, {"role": "user", "content": "What is the speed of light in km/s?"} ] }'Truncated response:
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1716240000, "model": "google/gemini-3.5-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Approximately 299,792 km/s." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 24, "completion_tokens": 9, "total_tokens": 33 }}Streaming
Section titled “Streaming”Set "stream": true in the request body to receive a stream of
Server-Sent Events. Each event is a JSON chunk shaped like
chat.completion.chunk; the stream terminates with data: [DONE].
See the curl streaming example for a complete walkthrough.
Next steps
Section titled “Next steps”- Authentication — API key scopes and rotation.
- Errors — handle
400,401,403,429, and502responses. - Code samples — the same flow in curl, PHP, and Node.