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 9

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, choose Create API key, and give the key a workload-specific name.

The full secret is shown once. Save it in an approved password manager or secret manager before closing the reveal. 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.

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:

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#

First request complete

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