The tutorials show how to get a key and stop at the billing page. Here is the part they skip for a developer in Algeria: paying in dinars, the first call, choosing a model by price, and charging your own customers.
Answers
use the OpenAI API from Algeria
Every tutorial on the OpenAI API follows the same steps: create an account, generate a key, add a payment method, start coding. In Algeria, the third step is where it stops.
This guide covers the parts those tutorials leave out. Each section leads to an article that goes further.
The wall is not technical. The API speaks a documented format, and your code can call it from anywhere.
The wall is the bill. The platform asks for an international card, and an Edahabia or CIB card cannot be that card: it pays only inside Algeria's card network.
An API key is the secret string your code sends with each request. Its role is to say who is calling, and whose balance pays.
Without a way to pay, the key never gets to work. The article on paying for the OpenAI API in Algeria shows what happens at that billing page, and why virtual cards keep failing there.
Can't I just use a VPN to get past it?
A VPN changes where your connection appears to come from. It does not change your card. The billing page refuses the card, not the connection.
OpenDunes speaks the same OpenAI format and bills in dinars. You deposit with your Edahabia or CIB card, create a key, and your code calls the same kind of endpoint.
Here is the path from nothing to a working key:
https://opendunes.com/v1 with that key.Keep your key out of your code and out of any shared repository. Anyone who reads it can spend your balance.
One request in a terminal proves everything works: the key, the balance and the address.
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-6-luna", "messages": [{"role": "user", "content": "Hello"}]}'The model's name starts with the lab that made it, then the model: openai/gpt-6-luna. Each model page shows that name.
Models differ a lot in price. Each model page shows what one message costs in dinars, a message meaning 1,000 tokens sent and 500 returned.
| Model | Price per message | What 3,000 DA buys |
|---|---|---|
| Llama 3.1 8B Instruct | about 0.028 DA | about 100,000 messages |
| GPT-6 Luna | about 0.11 DA | about 27,000 messages |
| DeepSeek V4 Flash | about 0.21 DA | about 14,000 messages |
| Claude Sonnet 5 | about 2.18 DA | about 1,300 messages |
Prices read on the model pages on 5 October 2026. They follow the providers, so read the page again before a large job.
Let's see right away what that means for a real workload.
Your assistant answers 20,000 messages a month. On GPT-6 Luna, that costs about 2,200 DA. On Claude Sonnet 5, about 43,600 DA.
Start on the lighter model, and move a task up only when its answers fall short.
Pick the most expensive model for every task because it is the best known.
Test two models on your real messages, compare the answers and the price, and keep the cheapest one that does the job.
Some developers think of running an open model on their own graphics card to avoid the bill altogether. The card, the power and the cooling cost far more than they look. The article on hosting an LLM locally in Algeria puts both sides in dinars.
If your app already uses the OpenAI libraries, you do not rewrite it. You change the base URL and the key, and your calls, prompts and parsing stay the same. The article on changing the OpenAI API base URL shows the two lines in Python and JavaScript.
Once your product runs, you want to be paid for it. Local cards cannot be charged automatically every month, so a classic subscription stops at the first renewal. The article on recurring subscription payments for an API in Algeria shows the prepaid model that works with Edahabia and CIB.
The other questions on building with AI from Algeria are gathered under Building with the API.