Hollow models are called with the OpenAI and Anthropic SDKs you already use. You change the base address and the key; nothing else. There is no Hollow SDK.
You need three things: credit on the account, an API key, and the key set as a shell variable.
- Add credit. Every model request is paid from prepaid credit, so you need some before the first request. An account with no credit can create keys, browse Models and read these guides, but a request is refused with HTTP 402 and the code
credit_exhausteduntil credit is added, and nothing is charged for a refused request. Add credit on Billing. See Errors and status codes for the 402 body. - Open Keys and choose Create API key. The default access (Models only) and expiry are right for a first request. A Project is the group that holds keys, limits and usage together, and the key is charged to the project you create it in.
- Copy the key when it is shown. It is shown once and cannot be shown again.
- Set it as a variable in your terminal with
export HOLLOW_API_KEY="paste-your-key-here". The curl samples below read$HOLLOW_API_KEY. In the Python and TypeScript samples, replace theHOLLOW_API_KEYtext with your key for a first try, then read it from an environment variable in your own code, never from source.
Both protocols use one address, https://models.projecthollow.com. The two SDK families differ only in the path they add and the base address they expect.
| Protocol | Path | SDK base address |
|---|---|---|
| OpenAI-compatible | /v1/chat/completions | https://models.projecthollow.com/v1 |
| Anthropic-compatible | /v1/messages | https://models.projecthollow.com |
This sends one message and prints the reply. The samples call the available chat model with the lowest input price in the Models table, so a copied request costs as little as possible.
curl 'https://models.projecthollow.com/v1/chat/completions' \
-H "Authorization: Bearer $HOLLOW_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-haiku-5-5",
"messages": [
{
"role": "user",
"content": "Hello from Hollow."
}
],
"max_tokens": 256
}'curl 'https://models.projecthollow.com/v1/messages' \
-H "Authorization: Bearer $HOLLOW_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-haiku-5-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Hello from Hollow."
}
]
}'Note: Send the key in the Authorization header
The API reads the key from Authorization: Bearer <key> and from nowhere else. The Anthropic SDKs send their api_key option as an x-api-key header, which is not read, so pass the key as the SDK's auth token instead (auth_token in Python, authToken in TypeScript). See Authentication.
Add "stream": true to ask for server-sent events on either protocol. The samples below stream the OpenAI-compatible reply as it is written.
# This request streams: the reply arrives as a stream of events, not one JSON body.
# Set stream to false (or leave it out) to get a single reply.
curl -N 'https://models.projecthollow.com/v1/chat/completions' \
-H "Authorization: Bearer $HOLLOW_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-haiku-5-5",
"messages": [
{
"role": "user",
"content": "Hello from Hollow."
}
],
"max_tokens": 256,
"stream": true
}'The reply is the standard shape of the protocol you called, with the token counts for the request in usage. The response does not include a cost: see what you have spent on Usage and Cost. Shortened examples of a good reply:
{
"id": "chatcmpl-example",
"object": "chat.completion",
"model": "claude-haiku-5-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}- OpenAI-compatible:
choices[0].message.contentholds the text, andusagehasprompt_tokens,completion_tokensandtotal_tokens. - Anthropic-compatible:
content[0].textholds the text, andusagehasinput_tokensandoutput_tokens. - The
modelfield is the id the request was run on. Hollow never swaps in a different model. - Cost follows usage: input tokens are charged at the model's input price and output tokens at its output price, both per million tokens in the Models table. Where a model has a prompt cache, a cache read (input served from a saved prompt) and a cache write (input saved for later) have their own prices.
The API accepts cross-origin requests, so a key placed in browser or mobile code can be used by any site or app that obtains it, and it spends your credit. Call Hollow from your backend, keep the key in an environment variable or secret store there, and let your own front end talk to your backend instead. See Authentication for rotating a key that may have been seen.
- Authentication: scopes, expiry, rotation and keeping the key out of client code.
- Models: every model id you can call, with its context window and status.
- Errors and status codes: what each failure means and which ones to retry.
- Limits: your credit, the optional spend caps and the request rate limit.
- Try a request without writing code in the Playground, which shows the same samples for your project.