A single base_url change 🧩
LangChain ships with native OpenAI support, so integrating our endpoint is a one-line change: set openai_api_base to our URL.

Minimal agent example
from langchain_openai import ChatOpenAI
chat = ChatOpenAI(model="gpt-4o-mini", openai_api_base="https://oneapi.daqi.tech/v1", api_key="sk-your-token")
What changes for each provider
| Component | Change required |
|---|---|
| ChatOpenAI | openai_api_base + api_key |
| OpenAIEmbeddings | openai_api_base + api_key |
| OpenAILLM | openai_api_base + api_key |
LangSmith / tracing 📊
Tracing keeps working because the requests still look like standard OpenAI calls to the framework.
Next steps
- Add a retry policy for transient errors
- Set per-token quota limits
- Cache tool outputs to reduce spend
Within ten minutes you can have an agent running on our endpoint ⚡.
Frequently asked questions ❓
Do I need to change any LangChain code?
No. Just set openai_api_base and api_key on the ChatOpenAI and OpenAIEmbeddings instances.
Do embeddings work the same way?
Yes. OpenAIEmbeddings accepts the same base URL and key, so vector stores work unchanged.
Can I use this with LangGraph agents?
Yes. Agents built on ChatOpenAI and OpenAI tools run without any extra wiring.
Where do I get the api_key?
Create a token in the panel and use it as your api_key.
How to Redeem Your API Credits
Every purchase on DaqiToken includes a unique redemption code (ONEAPI-XXXXXX). Here is how to turn it into usable credits:
1. Buy a package
Get your redemption code at checkout from the TOKEN store.
2. Log in
Open the Daqi account panel. Create an account in seconds if you do not have one.
3. Redeem
Paste the code in your account and press Redeem. Credits appear instantly.
4. Create an API token
Use your token as the API key with any OpenAI-compatible client.
Frequently asked questions ❓
How long does redemption take?
Credits appear on your account instantly after you press Redeem — there is no waiting period.
What if my code does not work?
Check for extra spaces or a typo first. If it still fails, contact support with your order number and we will sort it out.
Do credits expire?
No, credits never expire. You can keep them for as long as you need.
Can I split one code across multiple accounts?
No. Each redemption code can be used only once and credits go to the account that redeems it.
Comments (200)