# An OpenAI-compatible API: change the base URL, keep your code

> Use the OpenAI SDK with open-weight models: change base_url and model, keep your code. What works, what does not, and the price per token in crypto.

- URL: https://llmwithcrypto.com/openai-compatible-api/
- Last updated: 2026-10-23
- Publisher: LLMwithCrypto (https://llmwithcrypto.com)

If your app already talks to OpenAI, it can talk to DeepSeek, Qwen, gpt-oss, Llama or Mistral through us by changing two settings: the base URL and the model name. Here is exactly what is compatible, what is not, and how to switch.

**Quick answer — Is LLMwithCrypto compatible with the OpenAI API?**

Yes, for chat completions. **LLMwithCrypto** accepts the OpenAI chat completions format at `https://llmwithcrypto.com/api/v1/chat/completions`, so the official OpenAI SDKs, LangChain and other OpenAI-compatible tools work after you change the base URL and the model name. As of 23 October 2026 it serves 12 open-weight models, billed per token, paid in crypto with no KYC. Other OpenAI endpoints are not offered.

*Python: the OpenAI SDK pointed at LLMwithCrypto*

```python
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://llmwithcrypto.com/api/v1",
    api_key=os.environ["LLMWITHCRYPTO_API_KEY"],
)

resp = client.chat.completions.create(
    model="gpt-oss-120b",
    messages=[{"role": "user", "content": "Write a haiku about invoices."}],
)
print(resp.choices[0].message.content)

```

## Which OpenAI features work, and which do not?

What the API accepts on 23 October 2026. The [docs](https://llmwithcrypto.com/docs/) give the parameters of each endpoint.

| Feature | Status | Notes |
| --- | --- | --- |
| `POST /v1/chat/completions` | Supported | Messages, temperature, max tokens and the usual sampling settings |
| Streaming (`stream: true`) | Supported on every model | Server-sent events, token by token — see [streaming](https://llmwithcrypto.com/docs/streaming/) |
| Tool calling (`tools`) | On models that support it | Follows what the model itself supports — see [tool calling](https://llmwithcrypto.com/docs/tool-calling/) |
| JSON output (`response_format`) | On models that support it | Follows what the model itself supports |
| `GET /v1/models` | Supported | The model ids your key can call — see [models endpoint](https://llmwithcrypto.com/docs/models/) |
| `GET /v1/credits` | Ours, not OpenAI's | Credit left on the account |
| Responses API, Assistants | Not offered | Use chat completions |
| Embeddings, images, audio | Not offered | Text generation only |
| Fine-tuning, batch jobs | Not offered | — |

*Prices checked on October 23, 2026.*

## What do I change in my code?

Two settings, nothing else:

1. **Base URL** — `https://llmwithcrypto.com/api/v1` instead of OpenAI's.
2. **Model** — an id from the [models page](https://llmwithcrypto.com/models/), such as `deepseek-v4-pro` or `gpt-oss-120b`, instead of a GPT name.

The key goes where your OpenAI key went. Pass your API key as a Bearer token in the Authorization header, as the OpenAI SDK does. Store it in the `LLMWITHCRYPTO_API_KEY` environment variable rather than in your code. The [switching guide](https://llmwithcrypto.com/guides/switch-openai-sdk-to-open-models/) covers Python, Node.js, LangChain and environment-variable setups.

## What behaves differently from OpenAI?

- **The models.** Open-weight models answer differently from GPT. Test your prompts on two or three of them; switching costs one string.
- **Token counts.** You pay per token from your balance: input and output tokens are counted by the model’s own tokenizer and charged at that model’s price per 1M tokens. A call that ends in an error costs nothing. The same text can count a few more or fewer tokens than with OpenAI's tokenizer.
- **Features per model.** Streaming works on every model; tool calling and JSON output follow what each model itself supports.
- **Limits.** Every account has a per-minute request and token limit, shown in the dashboard; ask support and it can be raised.
- **Errors.** The status codes follow OpenAI's conventions; the [errors page](https://llmwithcrypto.com/docs/errors/) lists ours, including what happens when credit runs out.

## Which tools work with it?

The API speaks the OpenAI chat completions format: point the OpenAI SDK, LangChain or any OpenAI-compatible tool at our base URL with your key, and change the model name. In practice that covers the official OpenAI Python and Node.js SDKs, LangChain's OpenAI chat model with a custom base URL, and agent frameworks or editors that let you set an OpenAI-compatible endpoint. The [LangChain page](https://llmwithcrypto.com/docs/langchain/) shows the setup.

## What does it cost?

Per token, at each model's price on the [pricing page](https://llmwithcrypto.com/pricing/); credit is bought in packs and never expires.

| Plan | Quantity | Price | Price per unit |
| --- | --- | --- | --- |
| Start | $25 of API credit | $25 | — |
| Builder | $50 of API credit | $50 | — |
| Production | $100 of API credit | $100 | — |

In every plan: Every model on one key · Streaming and tool calling · Failed calls not charged · Credit never expires

**Before you pay**

- Minimum top-up $25. Top up once in crypto, then buy any plan from your balance.
- Credit on your balance does not expire and pays for tokens on any model, whenever you call the API. When a pack costs less than the minimum top-up, the part you paid only to reach that minimum comes back on request within 30 days of payment, in USDT or USDC, provided it is still unspent. The rest of a balance is not paid out unless the law requires it.
- Credited once your payment is checked on the blockchain. Typical network confirmation time: BTC ≈ 20 min · USDT TRC-20 ≈ 1 min · USDT ERC-20 ≈ 5 min · USDC ERC-20 ≈ 5 min · ETH ≈ 5 min · SOL ≈ 1 min · LTC ≈ 15 min

## Compatibility questions

### Can I call GPT models through this endpoint?

No. We do not sell access to GPT, Claude, Gemini or Grok: their makers forbid reselling API access without their approval, and we do not have it.

### Does the OpenAI Node.js SDK work?

Yes, with `baseURL` set to `https://llmwithcrypto.com/api/v1`. The [Node.js page](https://llmwithcrypto.com/docs/node/) has a complete example.

### What happens if I send a parameter a model does not support?

Streaming works on every model; tool calling and JSON output follow what each model itself supports. Test the parameter on the model you use; the [errors page](https://llmwithcrypto.com/docs/errors/) explains the responses you can get.

### Do I need a separate key per model?

No. One key calls every model; Make one API key per app, agent or teammate and revoke any of them from the dashboard without touching the others.

---

LLMwithCrypto: LLMwithCrypto is an OpenAI-compatible LLM API for open-weight models — DeepSeek V4 Pro, DeepSeek V4.1 Flash, DeepSeek R1, Qwen3.5 397B A17B, Qwen3 235B A22B Instruct, gpt-oss-120b, gpt-oss-20b, GLM-4.7, Llama 3.3 70B Instruct, Gemma 4 31B, Mistral Large 3, Mistral Small 4 — paid per token from a prepaid crypto balance, at 5% below the median price of the public hosts. No KYC: no ID, no selfie, no documents. Prompts and outputs are not stored.
