Skip to content
NewHost
Menu

Using an AI API in South Africa - Paying in Rand, Not Dollars

How to use an AI API from South Africa and pay in rand - prepaid credits vs your own provider key, VAT invoices, usage tracking and POPIA points to check.

By NewHost team · · 6 min read

If you build with AI APIs from South Africa, the code is the easy part. The friction is billing: dollar-priced usage on a foreign card, exchange-rate swings, declined payments and invoices your accountant can't use for VAT. You have two practical routes: pay each provider directly in dollars, or use a gateway that bills in rand and forwards your requests to the providers. This guide explains both, what "credits vs your own key" means, and what to check before you send customer data abroad.

Why paying for AI APIs is awkward from South Africa

Most large AI providers price usage per token in US dollars and charge a card on file, either up front (prepaid) or monthly in arrears. For a South African business that creates a few recurring problems:

  • Exchange-rate risk. Your usage cost in rand changes every month even if your token usage doesn't.
  • Card declines. Some local cards block or flag recurring foreign transactions, and a declined card can pause your API access mid-month.
  • Foreign transaction fees. Banks often add a fee on top of the converted amount.
  • Invoices. A foreign provider's invoice usually won't be a South African tax invoice, which makes input VAT and bookkeeping messier.
  • Many accounts. If you use Claude for one feature and Gemini or a Groq-hosted model for another, you now manage several dashboards, keys and bills.

None of these are show-stoppers for a hobby project. For a business with a monthly budget, they add up to admin time and uncertainty.

Option 1 - pay each provider directly

You create an account with each provider, add a card, generate an API key and call their API. This is the most direct path and gives you every provider-specific feature on day one.

It suits you if you only use one provider, your usage is small, your card works reliably for foreign payments, and you're comfortable reconciling dollar invoices.

Option 2 - an AI gateway that bills in rand

A gateway sits between your app and the AI providers. You call one API; the gateway routes each request to the provider you named. The NewHost AI gateway is OpenAI-compatible at https://api.newhost.co.za/ai/v1, so any code or library that speaks the OpenAI Chat Completions format works by changing the base URL and key.

Models are named provider/model, for example anthropic/claude-opus-5. Providers include Anthropic (Claude), OpenAI, Google Gemini, Mistral, Groq, DeepSeek, xAI and OpenRouter. You can list what's available from the /models endpoint.

curl https://api.newhost.co.za/ai/v1/models \
  -H "Authorization: Bearer $NEWHOST_API_KEY"

A chat request looks exactly like an OpenAI one:

curl https://api.newhost.co.za/ai/v1/chat/completions \
  -H "Authorization: Bearer $NEWHOST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-5",
    "messages": [{"role": "user", "content": "Summarise POPIA in two sentences."}]
  }'

For full Node.js and Python examples, see calling Claude with the OpenAI SDK.

Prepaid credits vs bring your own key

The NewHost gateway supports two payment modes. You can mix them.

Prepaid AI credits (rand) Bring your own provider key
Who bills the tokens NewHost, in rand The provider, in their currency
Invoice VAT invoice from NewHost Provider's invoice
Provider accounts needed None One per provider you use
Budget control Spend is capped by your credit balance Depends on the provider's own limits
Best for Predictable rand budgets, several providers Existing provider contracts or discounts

Prepaid credits work like a prepaid airtime balance. You top up in rand, pay with card, instant EFT, bank EFT or your wallet balance, and each request deducts its cost. When credits run out, requests stop rather than running up a surprise bill. That hard ceiling is useful for side projects, internal tools and anything exposed to the public.

Bring your own key means you store your provider key and the gateway uses it. The provider bills you directly. This makes sense if you already have an enterprise agreement, committed-use discount or data-processing terms with a provider and want to keep them, while still using one API surface in your code.

Usage tracking

Whichever mode you use, you should be able to answer "what did that feature cost last week?" The gateway records each request's model, token counts and cost. Prompts and responses themselves are not stored, which keeps the gateway's own footprint of personal information small.

Practical habits that keep costs visible:

  1. Use a separate API key per app or environment. Production, staging and your laptop shouldn't share a key. When one leaks or misbehaves, you revoke just that one.
  2. Set max_tokens on every request. It caps the length of each response, which caps the cost of a runaway loop.
  3. Pick the smallest model that does the job. Classification, extraction and short summaries rarely need the largest model. Test a cheaper one first.
  4. Cache repeat answers. If many users ask the same question, store the answer rather than paying for it twice.
  5. Review usage weekly while a feature is new. Surprises usually come from retries, long conversation histories or a bug that calls the API in a loop.

VAT and bookkeeping

NewHost prices are in rand excluding VAT, and you receive VAT invoices for purchases, including AI credit top-ups. If you're a VAT vendor, that gives your bookkeeper a normal local tax invoice to work with. For how imported digital services are treated when you pay a foreign provider directly, check SARS guidance or ask your accountant, as the details depend on your registration and the supplier.

POPIA - sending personal information to AI providers

The billing may be local, but the models run on the providers' infrastructure, which is generally outside South Africa. If your prompts contain personal information (names, ID numbers, contact details, health data, customer messages), sending them to a model is a transfer of personal information across the border.

Section 72 of POPIA only allows that in specific circumstances, for example where the recipient is subject to adequate data-protection law or binding agreements, or the data subject consents. Read POPIA section 72 and AI APIs for the detail, and keep these rules of thumb:

  • Strip or mask personal information you don't need before sending a prompt.
  • Tell users in your privacy policy that AI providers process their data, and where.
  • Check each provider's data-use and retention terms, especially whether inputs are used for training.
  • Get professional advice if you process special personal information or children's data.

The POPIA for developers guide covers the wider obligations.

Frequently asked questions

Can I use Claude or GPT models from South Africa?

Yes. The major AI APIs are available to South African developers, either directly from the providers or through a gateway. What changes by route is how you pay, which invoices you get and how many accounts you manage.

Is an AI gateway slower than calling the provider directly?

A gateway adds one extra network hop, and the model's own processing time is usually the larger part of a response. Test with your real prompts; for most chat and summarisation features the difference isn't what users notice.

What happens when my prepaid AI credits run out?

Requests using credits are declined until you top up, so you can't overspend your balance. Keep an eye on usage and top up before a busy period, or use your own provider key for workloads that must never stop.

Do I need to rewrite my code to use a gateway?

Not if your code already uses the OpenAI format. Point the SDK's base URL at https://api.newhost.co.za/ai/v1, use your NewHost key and change the model name to the provider/model form.

Does the gateway store my prompts?

No. The NewHost gateway records usage (model, tokens and cost) for billing and reporting, but prompts and responses are not stored.

If you want AI usage on the same rand invoice as your hosting, read the AI gateway docs at docs.newhost.co.za and compare plans on the pricing page.

Related guides

Ready to launch on NewHost?

Choose a plan and go live today, or tell us what you need and we'll recommend the right setup.