Skip to main content

Use with the OpenAI SDK

Alchemyst exposes an OpenAI-compatible chat completions endpoint, so you can keep using the OpenAI SDK and only change the baseURL. Answers are grounded in your private Alchemyst context, and the default model is Big Bull Alpha.

1. Install the SDK

2. Point the client at Alchemyst

The SDK appends /chat/completions to baseURL, so end it at /chat:
This targets POST /api/v1/context/search/chat/completions for completions and GET /api/v1/context/search/chat/models for model listing.

3. Make your first request

Authentication options

OpenRouter-only callers must send an email on the first request. If an Alchemyst account already exists for that email, authenticate with the Alchemyst API key instead.

Bring your own model key

Send a provider key as llm_api_key (or x-llm-api-key) to use OpenRouter or another compatible provider.
You can also pass any OpenRouter provider/model id as model. Set mode to trade latency for retrieval depth:
  • standard (default) performs a more complete search.
  • fast prioritizes latency.

Include the grounding context

Pass ?context=true to receive the joined context alongside the completion:

Stream responses

stream: true is proxied as text/event-stream, so the usual OpenAI streaming helpers work:

Next steps