API Documentation
Access AI models using the OpenRouter and OpenAI APIs
What is iTtech?
iTtech is a Bangladesh-based platform that provides AI API access through OpenRouter and OpenAI.
With OpenRouter you can use Claude, GPT, Gemini, Grok and 400+ AI models through a single API. With OpenAI you can use GPT, image, speech and embedding models directly. Buy credits from Bangladesh with bKash or Nagad — no international payment method required.
OpenRouter or OpenAI — which one, when?
A quick comparison:
OpenRouter Pay-as-you-go
- 400+ models in one place (GPT, Claude, Gemini, Llama, DeepSeek)
- Exact charge per request — fully transparent cost
- Ideal if you want to compare multiple providers
- Switch models with a single line change
OpenAI Direct Project credit
- Only OpenAI's own models (GPT, image, Sora, embeddings)
- Direct credit — OpenAI's official pricing
- Images, audio, embeddings — all with the same key
- Simpler if you only use the OpenAI stack
Quickstart
Get your first API response in under 5 minutes.
Add balance
Topup via bKash/Nagad. Admin verification activates your balance.
Generate an API key
Create your API key from the dashboard and copy it somewhere safe.
Send your first request
Copy the cURL example below and run it in your terminal.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4.1-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}'You're all set!
Explore the code examples and use-case tutorials below to build more.
Code Examples
Ready-to-use snippets in your favorite language or tool.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4.1-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}'Works directly from any terminal — great for quick testing.
Use-case Tutorials
Practical, copy-paste examples for common projects.
Build a mini chatbot
Keep a messages array, push each user message, send the whole array to /chat/completions and append the assistant reply. Use a cheap model like openai/gpt-4.1-mini.
Generate images
Pick an image model (e.g. google/gemini-2.5-flash-image) from the Models page, send a prompt in messages and read the image from the response.
Automate an email reply with n8n
Gmail Trigger → HTTP Request (chat/completions with the email body) → Gmail Reply node using the model's answer.
Troubleshooting FAQ
Common issues and how to fix them.
❌ Getting "401 Unauthorized" / "Invalid API key"
Check that the header is exactly 'Authorization: Bearer YOUR_KEY' with no extra spaces, and that the key is not revoked.
💳 "402 Insufficient Credits" — what should I do?
Your balance is empty. Top up via bKash/Nagad and wait for admin verification.
🤔 Which model should I pick? (cheap vs premium)
Start with a mini/flash model for everyday tasks. Use Claude or GPT premium models only for hard reasoning or coding.
⏱️ Requests are slow or timing out
Use streaming (stream: true), lower max_tokens, or switch to a faster model.
