OpenAI-Compatible, Open Models
If your code talks to the OpenAI API, it already talks to sparehash. Change the base URL, pick a model, keep everything else.
Your First Request
Base URL: https://your-coordinator.fly.dev/v1
curl https://your-coordinator.fly.dev/v1/chat/completions \ -H "Authorization: Bearer $SPAREHASH_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen3-8b", "messages": [{"role": "user", "content": "Hello!"}]}'
import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.SPAREHASH_KEY, baseURL: 'https://your-coordinator.fly.dev/v1' }); const stream = await client.chat.completions.create({ model: 'llama-3.1-8b-instruct', stream: true, messages: [{ role: 'user', content: 'Write a haiku about idle GPUs.' }], }); for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
import os from openai import OpenAI client = OpenAI(api_key=os.environ["SPAREHASH_KEY"], base_url="https://your-coordinator.fly.dev/v1") vectors = client.embeddings.create(model="nomic-embed-text", input=["hello", "world"])
Private By Default
Before a request leaves sparehash, the privacy filter swaps credentials and personal data for
placeholders. The machine that runs the model only ever sees [EMAIL_1] or
[SECRET_1]; the real values are put back into the answer before it reaches you.
What's masked
- API keys and tokens: OpenAI, Anthropic, Google, AWS, GitHub, Stripe, Slack, Hugging Face, JWTs, private keys
- Passwords and secrets written as
key=value, and passwords inside connection strings - Email addresses, phone numbers, card numbers, US SSNs and IBANs
And around it
- The sparehash app runs models in a sandbox and never writes prompts to disk or logs
- Hidden test requests check every node around the clock; nodes that fail are quarantined, then banned
- Add
X-Trusted-Only: 1to use only verified, long-standing nodes
Know the limits
- Names, street addresses and secrets written in plain words ("my PIN is the year I was born") can't be recognised, so they aren't masked
- The model has to read your text to answer it. Someone who takes their own computer apart could still read the parts that aren't masked
- For health, legal or financial records, call the provider directly from your own account rather than through a shared network
curl https://your-coordinator.fly.dev/v1/chat/completions \ -H "Authorization: Bearer $SPAREHASH_KEY" \ -H "X-Privacy-Filter: secrets" \ -H "X-Trusted-Only: 1" \ -H "Content-Type: application/json" \ -d '{"model": "qwen3-32b", "messages": [{"role": "user", "content": "Draft a reply to [email protected]"}]}' # x-sparehash-masked: number of values that were swapped out
GPT, Claude and Gemini, Discounted
Sellers with spare capacity on official provider accounts list it on sparehash at a discount off the provider's list price. Call those models through the same key: put the provider in front of the model name. Requests go from sparehash straight to the provider's official API.
Official providers only
| Provider | Model name |
|---|---|
| OpenAI | openai/gpt-6.1-sol |
| Anthropic | anthropic/claude-sonnet-5.5 |
| Google Gemini | google/gemini-3.8-flash |
| Mistral AI | mistral/mistral-small-2603 |
| xAI | xai/grok-4.7 |
| DeepSeek | deepseek/deepseek-v4.1-flash |
| Alibaba Cloud (Qwen) | alibaba/qwen3.8-flash |
How it works
- Your request goes to the deepest discount that's live and healthy, and to the next seller if one fails before answering
- You pay the provider's list price minus the seller's discount, from your USDC credits
- Sellers never see requests, and the privacy filter applies here too
- Tools, images and the provider's other features pass through untouched
- What's on sale right now:
GET /v1/modelsor the markets page
const reply = await client.chat.completions.create({ model: 'anthropic/claude-sonnet-5.5', messages: [{ role: 'user', content: 'Summarise this contract in three bullet points.' }], }); // x-sparehash-route: market · x-sparehash-discount-bps: 7500
What Works Today
Supported
POST /v1/chat/completionswithstreamandstream_options.include_usagePOST /v1/embeddings, float or base64GET /v1/models, with pricing and license per modelmax_tokens,temperature,top_p,stop,seed,response_format: json_object- On provider models (
anthropic/…,openai/…): everything that provider supports
Not yet on sparehash nodes
- Tool / function calling (returns a clear 400)
- Image inputs, and
ngreater than 1 - Fine-tuning, files, assistants and batch APIs
Status Codes
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_privacy_filter | X-Privacy-Filter isn't standard, secrets or off |
| 401 | invalid_api_key | Missing, wrong or revoked key |
| 402 | insufficient_quota | Not enough credits for this request's worst case |
| 404 | model_not_found | Unknown model id, or no seller lists that provider model |
| 429 | rate_limit_exceeded | Requests or tokens per minute; honour retry-after |
| 502 | upstream_failed | Every node failed; you were not charged |
| 503 | no_capacity | No node or seller is serving that model right now |
Request errors from a provider (e.g. an unsupported parameter) are passed through as the provider sent them.
Get Your Key
Sign in with your wallet, add USDC credits and create an API key.