Developer quickstart
Create a key, install one client, and print your first eb1 response. The Python path below is copy-run complete and keeps the API key out of source code, shared environment files, and shell history.
On this page 1 of 10
0. Get access#
eb1 is in invite-only beta. Request access at the console request-access page; you will receive an invite email with a console login and a support channel.
1. Create an API key#
Open API Keys in the Keiro console and choose Create API key. Name the key after where you will use it, for example laptop-python.
The console shows the full key only once. Copy it into your password manager or secret manager before you close that window. Do not paste it into this page, a repository, a ticket, or a screenshot.
2. Install the OpenAI Python SDK#
Use Python 3.11 or newer. A virtual environment keeps the install local to this walkthrough and avoids the externally-managed-environment error on system Pythons:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade openai
3. Create the request script#
Save this as quickstart.py:
from getpass import getpass
from openai import OpenAI
client = OpenAI(
base_url="https://api.keirolabs.ai/v1",
api_key=getpass("Keiro API key: "),
)
response = client.responses.create(
model="eb1-preview",
input="In one sentence, explain why idempotency matters.",
)
print(response.output_text)
getpass() reads the key without echoing it and passes it directly to this client process. The script never stores the secret.
4. Run it#
python3 quickstart.py
At the prompt, paste the key you saved. A successful run prints one generated sentence, for example:
Idempotency lets a safely retried operation return the original result without executing twice.
The wording varies. Success means the process exits normally and response.output_text contains generated text.
Run from a script or CI job#
getpass() needs a person at a terminal. In a script, a CI job, or an agent run, read the key from a file that your secret manager writes instead. KEIRO_KEY_FILE holds the file's path, not the key. Save this as quickstart_ci.py:
import os
from pathlib import Path
from openai import OpenAI
key_path = os.environ.get("KEIRO_KEY_FILE")
if not key_path:
raise SystemExit("KEIRO_KEY_FILE must point to a protected secret file")
client = OpenAI(
base_url="https://api.keirolabs.ai/v1",
api_key=Path(key_path).read_text(encoding="utf-8").strip(),
)
response = client.responses.create(
model="eb1-preview",
input="In one sentence, explain why idempotency matters.",
)
print(response.output_text)
Run it with the path to your key file:
KEIRO_KEY_FILE=/absolute/path/to/key python3 quickstart_ci.py
It prints one generated sentence, like quickstart.py.
Make the key file readable only by the account that runs the job (chmod 600), and do not commit it.
Raw HTTP alternative#
Use this path to verify the exact request and response body without an SDK:
printf 'Keiro API key: '
IFS= read -rs KEIRO_BEARER
printf '\n'
curl -sS https://api.keirolabs.ai/v1/responses \
-H "Content-Type: application/json" \
-d '{
"model": "eb1-preview",
"input": "In one sentence, explain why idempotency matters."
}' \
-H @- <<<"Authorization: Bearer $KEIRO_BEARER"
The prompt works in both bash and zsh, and -H @- (curl 7.55 or newer) reads the Authorization header from stdin so the secret never appears in the process argument list.
In raw JSON, generated text appears in the assistant message's output content. SDK output_text is the convenient aggregate of those text parts.
Keiro CLI alternative#
The native CLI stores credential metadata and owner-only secret files through its setup flow. The keiro package needs Python 3.11, 3.12, or 3.13; it does not install on Python 3.14 yet. If python3 --version prints 3.14, follow the Python 3.13 steps in SDKs and CLI.
python3 -m pip install --upgrade keiro
keiro setup
keiro "In one sentence, explain why idempotency matters."
Use this saved-credential path for later Keiro CLI and native-client work.
Troubleshooting#
| Symptom | Check |
|---|---|
401 | The key was copied completely, is still active, and belongs to the selected organization |
403 | The key or organization is not allowed to use the requested capability |
404 or model error | The base URL includes /v1, and eb1-preview appears in GET /v1/models for this key |
429 | Honor Retry-After; check account rate or spend limits before retrying |
| Connection or TLS failure | Check Status and support and confirm the exact public base URL |
Python has no output_text | Upgrade the OpenAI SDK and inspect the raw output items for text content |
Do not solve an authentication failure by putting the key into a URL, command argument, source file, or shared environment file.
Next steps#
- Hand setup to your coding agent with Agent-driven setup.
- Run your coding agent on eb1: Claude Code, Codex, OpenCode, Pi, or Omnigent. Create a separate API key for each tool. Each setup takes a few minutes.
- Building an application? Choose an endpoint in API reference and compare public IDs in Models.
- Migrating existing code? See SDKs and CLI and Migration.
- Before load testing: Errors, Idempotency, and Usage and billing.
After your first request
You are ready to build
Choose a model for your workload, add production-safe error handling, or connect tools to your next request.