Crucible Docs

How to use it

Call the LLM Gateway with an OpenAI-compatible client and choose a provider model or gateway alias.

Call the gateway

Point an OpenAI-compatible client at LLM_GATEWAY_ENDPOINT, authenticate with LLM_GATEWAY_API_KEY, and pass a gateway alias or a provider/model string as model. Use the Responses API for new work.

gateway_client.py
import asyncio
import os

from openai import AsyncOpenAI

client = AsyncOpenAI(
    api_key=os.environ["LLM_GATEWAY_API_KEY"],
    base_url=os.environ["LLM_GATEWAY_ENDPOINT"],
)


async def main() -> None:
    baseline = await client.responses.create(
        model="frontier-production",
        input="Review this migration plan for hidden deployment risk.",
    )
    print(baseline.output_text)

    pinned = await client.responses.create(
        model="anthropic/claude-opus-5",
        input="Review this changelog for user-facing risk.",
    )
    print(pinned.output_text)

    routed = await client.responses.create(
        model="fast-production",
        input="Summarize the latest support ticket.",
    )
    print(routed.output_text)


if __name__ == "__main__":
    asyncio.run(main())

Keep provider credentials out of the project. The gateway variables are the only credentials your code needs.

Choose a model

Aliases keep application code stable while Ciridae updates the models behind them. Start a new agent task on frontier-production, prove quality on representative evals, then test cheaper aliases against the same evals. Estimate total cost before scaling a batch.

Model valueUse it forFallback on provider failure
frontier-productionEstablishing whether a new task is solvableNo; errors surface after retries
strong-productionProven tasks that need strong reasoning at higher volumeYes, across providers
fast-productionProven chat, summaries, and short transformationsYes, across providers
tiny-productionTrivial classification and high-volume, low-risk workYes, across providers
openai/..., anthropic/..., gemini/...Behavior that needs one specific provider modelNo

Use the OpenAI Agents SDK

The gateway supports the Responses API calls the OpenAI Agents SDK makes. Wrap a gateway-backed client in OpenAIResponsesModel, then change the model value without rewriting the agent.

gateway_agent.py
import asyncio
import os

from agents import Agent, OpenAIResponsesModel, RunConfig, Runner
from openai import AsyncOpenAI

gateway_client = AsyncOpenAI(
    api_key=os.environ["LLM_GATEWAY_API_KEY"],
    base_url=os.environ["LLM_GATEWAY_ENDPOINT"],
)

agent = Agent(
    name="Support triage",
    instructions="Classify the request and recommend the next step.",
    model=OpenAIResponsesModel(
        model="strong-production",
        openai_client=gateway_client,
    ),
)


async def main() -> None:
    result = await Runner.run(
        agent,
        "Plan the next action for this workflow.",
        run_config=RunConfig(tracing_disabled=True),
    )
    print(result.final_output)


if __name__ == "__main__":
    asyncio.run(main())

On this page