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#

Create 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:

Install with pip Shell
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade openai

3. Create the request script#

Save this as quickstart.py:

Run a Python request Python
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#

Run in the terminal Shell
python3 quickstart.py

At the prompt, paste the key you saved. A successful run prints one generated sentence, for example:

Text
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:

Run a Python request Python
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:

Run in the terminal Shell
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:

Run a curl request Shell
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.

Configure Keiro CLI Shell
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#

SymptomCheck
401The key was copied completely, is still active, and belongs to the selected organization
403The key or organization is not allowed to use the requested capability
404 or model errorThe base URL includes /v1, and eb1-preview appears in GET /v1/models for this key
429Honor Retry-After; check account rate or spend limits before retrying
Connection or TLS failureCheck Status and support and confirm the exact public base URL
Python has no output_textUpgrade 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#

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.

Search Keiro docs

Start typing to search pages and sections.

Start typing to search pages and sections.

Documentation

Console