Skip to content

API keys are not open yet. These docs describe the API as it will work when keys open, so you can plan your integration now.

Docs

Getting started

Make your first request to the ewpire API in a few minutes, with curl or the official OpenAI SDK.

The ewpire API gives you the text models in the ewpire catalog through one endpoint, one key and one credit balance. It speaks the OpenAI chat completions format, so the official OpenAI SDKs work once you point them at ewpire.

Base URL: https://ewpire.com/api/v1

1. Create an account and add credits

Create an account at ewpire.com with your email. The account is free; requests are paid from your credit balance, so add credits under Billing before your first call. You can add from 10 to 2,000 credits at a time. See Pricing for how credits work.

2. Create an API key

Open API in the app and create a key. The secret is shown once, so copy it straight into an environment variable:

curl

export EWPIRE_API_KEY="ewp_live_..."

3. Send your first request

Use "auto" as the model and ewpire picks one for the request, or pass any model id from Models.

curl https://ewpire.com/api/v1/chat/completions \
  -H "Authorization: Bearer $EWPIRE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "max_tokens": 200, "messages": [{"role": "user", "content": "Say hello in one sentence."}]}'

The answer comes back in the OpenAI format. Two extra response headers tell you what the request cost and what is left: X-Ewpire-Credits-Charged and X-Ewpire-Balance.

Where to go next

  • Authentication – how keys are sent and checked.
  • Chat – streaming, images, tools and structured output.
  • Usage – what each request costs and how to read your usage.
  • Errors and Rate limits – what to retry and when.