Skip to content

AI Tools Get uptp 50% Off Learn more β†’

AiStore
Shop
Sign in Get started

Developers

AiStore AI API

Use our AI models over a standard HTTP API β€” OpenAI-compatible and Anthropic-compatible, so the tools you already use (Cline, VS Code, Cursor, any SDK) work without new libraries. Every request deducts AI credits from your AiStore account.

Quickstart

  1. Create an account, add money and buy AI credits.
  2. Open API Keys and generate your secret key (sk-…).
  3. Make your first call:
curl https://mail.aishop.bd/api/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Authentication

Send your key as a bearer token on every request. One active key per account β€” regenerating immediately revokes the previous key.

Authorization: Bearer sk-YOUR_KEY

Base URLs

Two compatible surfaces, one key. Pick whichever your client speaks.

OpenAI-compatible

https://mail.aishop.bd/api/v1

Use with the OpenAI SDK, Continue, most IDE plugins.

Anthropic-compatible

https://mail.aishop.bd/api

Use with Cline ("Anthropic Compatible") or the Anthropic SDK.

Chat completions (OpenAI format)

POST https://mail.aishop.bd/api/v1/chat/completions

Supports streaming ("stream": true). Both GPT-family and Claude-family models work through this one endpoint.

curl https://mail.aishop.bd/api/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain SSE in one sentence."}
    ],
    "stream": false
  }'

Response

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "gpt-6-luna",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "Server-sent events stream…"},
      "finish_reason": "stop"
    }
  ],
  "usage": {"prompt_tokens": 21, "completion_tokens": 14, "total_tokens": 35},
  "x_cost_usd": 0.0012
}

When streaming, you receive chat.completion.chunk objects followed by a final chunk carrying usage and x_cost_usd, then a data: [DONE] sentinel.

Messages (Anthropic format)

POST https://mail.aishop.bd/api/v1/messages

curl https://mail.aishop.bd/api/v1/messages \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "system": "You are a helpful assistant.",
    "messages": [
      {"role": "user", "content": "Hello, Claude!"}
    ]
  }'

Response

{
  "id": "msg_…",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-4-6",
  "content": [{"type": "text", "text": "Hello! How can I help?"}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 12, "output_tokens": 9}
}

With "stream": true you get the standard Anthropic event sequence: message_start β†’ content_block_delta β†’ message_stop.

Use with Claude Code

Run Claude Code β€” the terminal coding agent β€” on your AiStore credits. No Anthropic subscription or foreign card needed. Tool calls, streaming and token usage are fully supported on every Claude model.

macOS / Linux

export ANTHROPIC_BASE_URL=https://mail.aishop.bd/api
export ANTHROPIC_AUTH_TOKEN=sk-YOUR_KEY
export ANTHROPIC_MODEL=claude-sonnet-4-6
claude

Windows (PowerShell)

$env:ANTHROPIC_BASE_URL = "https://mail.aishop.bd/api"
$env:ANTHROPIC_AUTH_TOKEN = "sk-YOUR_KEY"
$env:ANTHROPIC_MODEL = "claude-sonnet-4-6"
claude
  • Generate your key on the AI Tools β†’ API Keys page (sk-…).
  • Pick any Claude model id from the table below β€” e.g. claude-sonnet-4-6.
  • Every request bills your AI credits at the listed price β€” nothing else is charged.
  • ANTHROPIC_API_KEY works too β€” it is sent as the x-api-key header.

Cline / VS Code setup

Coding agents that live inside VS Code β€” Cline, Kilo Code, Roo Code β€” run on your AiStore credits too. Pick the Anthropic provider and point its base URL at this API: tool calls, file edits and streaming work exactly like the official providers, with no foreign card.

Cline (VS Code)

  1. Install the Cline extension, then open Cline β†’ Settings (βš™).
  2. API Provider: Anthropic.
  3. Base URL: https://mail.aishop.bd/api
  4. API Key: your sk-… key from the API Keys page.
  5. Model: any Claude model from the table below, e.g. claude-sonnet-4-6.

Prefer the OpenAI format? Choose OpenAI Compatible instead and use base URL https://mail.aishop.bd/api/v1 β€” tool calls then require an OpenAI-tools-capable client.

Kilo Code / Roo Code (VS Code)

  1. Open the extension settings and pick API Provider Anthropic.
  2. Set the custom base URL to https://mail.aishop.bd/api and paste your sk-… key.
  3. Choose a Claude model id β€” agentic editing (tool use) is supported on every claude-* model.

Any other OpenAI-compatible tool

Base URL: https://mail.aishop.bd/api/v1
API key:  sk-YOUR_KEY
Model:    any chat model id from the list below
  • Tool / agent workflows need a claude-* model through the Anthropic endpoint.
  • The :free models cost 0 credits β€” great for testing your setup.
  • Every request bills the AI credits on your account β€” nothing else is charged.

Models

GET https://mail.aishop.bd/api/v1/models

Model id Capability Price (USD)
claude-fable-5 Chat $5.20/M in Β· $26.00/M out
claude-opus-5-5 Chat $2.08/M in Β· $10.40/M out
claude-sonnet-4-6 Chat $1.10/M in Β· $5.55/M out
deepseek-v4-1-flash Chat $1.00/M in Β· $2.00/M out
dots-studio/dots-3-note-preview:free Chat $0.00/M in Β· $0.00/M out
gpt-6-sol Chat $1.00/M in Β· $3.00/M out
gpt-6-luna Chat $0.04/M in Β· $0.20/M out
grok-4-7 Chat $1.04/M in Β· $3.12/M out
nvidia/nemotron-3-ultra-550b-a55b:free Chat $0.00/M in Β· $0.00/M out
nvidia/nemotron-3.5-lightning:free Chat $0.00/M in Β· $0.00/M out
gpt-image/1.5-text-to-image Image $0.03/image
ideogram/v3-text-to-image Image $0.05/image
seedream/5-flash-layer-decomposition Image $0.02/image
seedream/5-pro-text-to-image Image $0.05/image
elevenlabs/ten-v3-text-to-speech Audio $0.02/generation
elevenlabs/text-to-speech-multilingual-v2 Audio β‰ˆ$0.08/1,000 chars
elevenlabs/text-to-speech-turbo-2-5 Audio β‰ˆ$0.04/1,000 chars
google/gemini-3-8-flash-lite-tts Audio β‰ˆ$0.05/1,000 chars
ai-music-api/create-music-video Audio $0.01/generation
ai-music-api/generate Audio $0.06/generation

Image generation (async job)

POST https://mail.aishop.bd/api/v1/images/generations

Image, audio, and video generation run as async jobs: submit a task, then poll until status is success or failed. Jobs are billed upfront and refunded automatically on failure.

curl https://mail.aishop.bd/api/v1/images/generations \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ideogram/v3-text-to-image",
    "prompt": "a cozy cabin in snowy woods at dusk",
    "aspect_ratio": "16:9",
    "n": 1
  }'

# β†’ 202 Accepted
{ "id": 42, "object": "generation.job", "status": "processing", "price": 0.05, ... }

Common params: model, prompt, aspect_ratio, n (1–4). seedream/5-pro-text-to-image prices by quality tier β€” basic (1K) $0.05 / high (2K) $0.09 per image β€” and also accepts output_format (png|jpeg) and nsfw_checker (boolean). Models may cap n β€” Seedream generates a single image per request. seedream/5-flash-layer-decomposition splits a supplied image_url (required) into independent layers β€” it takes size (auto|1K|1.5K|2K) instead of aspect_ratio and bills $0.02 per returned image (every layer, including the base image, counts as one): one image is held upfront and the difference settled when the job completes.

Audio generation (async job)

POST https://mail.aishop.bd/api/v1/audio/generations

curl https://mail.aishop.bd/api/v1/audio/generations \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "elevenlabs/ten-v3-text-to-speech",
    "prompt": "Welcome to our store!",
    "voice": "optional-voice-id",
    "format": "mp3"
  }'

Voice-tuned speech (ElevenLabs voice_tuning models β€” billed per 1,000 characters)

curl https://mail.aishop.bd/api/v1/audio/generations \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "elevenlabs/text-to-speech-turbo-2-5",
    "prompt": "Unlock powerful API with Kie.ai!",
    "voice": "EkK5I93UQWFDigLMpZcX",
    "stability": 0.5,
    "similarity_boost": 0.75,
    "style": 0,
    "speed": 1,
    "language_code": "en",
    "nsfw_checker": true
  }'
  • elevenlabs/text-to-speech-turbo-2-5 (β‰ˆ$0.04/1,000 chars) and elevenlabs/text-to-speech-multilingual-v2 (β‰ˆ$0.08/1,000 chars) accept the voice-tuning params above, plus optional timestamps (boolean) and previous_text / next_text for chunk continuity. 422 on models without voice tuning.
  • stability, similarity_boost, style are 0–1; speed is 0.7–1.2; language_code picks the language on multilingual models (e.g. en, bn).

Multi-speaker dialogue (dialogue TTS models)

curl https://mail.aishop.bd/api/v1/audio/generations \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-3-8-flash-lite-tts",
    "speakers": [
      { "speaker_id": "Speaker 1", "voice_name": "Fola" },
      { "speaker_id": "Speaker 2", "voice_name": "Alnilam" }
    ],
    "dialogue_turns": [
      { "speaker_id": "Speaker 1", "text": "Halt, traveler! The northern pass is sealed." },
      { "speaker_id": "Speaker 2", "style": "whisper quietly", "text": "Then I will take the river path." }
    ],
    "filler_words": true,
    "temperature": 1
  }'
  • dialogue_turns β€” 1–50 ordered turns (speaker_id, optional style up to 500 chars, text up to 2,000); every speaker_id must appear in speakers (max 2, unique ids β€” or omit speakers and every turn speaker gets the model's default voice). Dialogue fields are only accepted by models that list them β€” a plain prompt becomes a single-speaker turn there.
  • filler_words (boolean) / temperature (0–2) β€” optional delivery controls for dialogue models.
  • Send either prompt or dialogue_turns, never both.

Video generation (async job)

POST https://mail.aishop.bd/api/v1/videos/generations

curl https://mail.aishop.bd/api/v1/videos/generations \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan/2-7-text-to-video",
    "prompt": "a drone shot over misty mountains at sunrise",
    "duration": 5,
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }'
  • resolution / duration accepted values come from the model's row in the table above (duration 5–15s, up to 30s on models that list it).
  • image_urls β€” optional array (max 2) of public image URLs for image-to-video / reference models (e.g. grok-imagine/image-to-video, pixverse-v6/reference-to-video); required there, ignored by text-to-video models.
  • audio β€” optional boolean, models with the audio flag only (e.g. wan/3-0-video-prime): generates music + dialogue baked into the video. 422 on models without it.

Polling a job

GET https://mail.aishop.bd/api/v1/generations/{id}

curl https://mail.aishop.bd/api/v1/generations/42 \
  -H "Authorization: Bearer sk-YOUR_KEY"

# β†’ while running
{ "id": 42, "status": "processing", "urls": [], ... }

# β†’ when finished (URLs valid ~24 hours)
{ "id": 42, "status": "success", "price": 0.05,
  "urls": ["https://…/image.png"], ... }

# β†’ on failure (charge refunded automatically)
{ "id": 42, "status": "failed", "error": "…", "price": 0.05, "urls": [] }

Store & wallet (run a shop from any bot or app)

Browse the catalog

GET https://mail.aishop.bd/api/v1/store/products

Every active product on the website with its pricing options and live stock β€” everything a bot needs to render a shop menu.

curl https://mail.aishop.bd/api/v1/store/products \
  -H "Authorization: Bearer sk-YOUR_KEY"

# β†’
{ "object": "list", "data": [
  { "object": "store.product", "id": 7, "slug": "chatgpt-plus",
    "title": "ChatGPT Plus", "brand": "OpenAI",
    "description": "…", "image": "https://…/chatgpt.jpg",
    "delivery_type": "manual",
    "stock": { "type": "private_account", "available": 12, "in_stock": true },
    "prices": [
      { "id": 21, "duration": "1 Month", "price": 19.0, "is_default": true },
      { "id": 22, "duration": "3 Months", "price": 49.0, "is_default": false }
    ],
    "url": "https://mail.aishop.bd/products/chatgpt-plus" } ] }

One product: GET https://mail.aishop.bd/api/v1/store/products/{slug} β€” same shape, plus the product_price_id values the purchase call below expects. Upstream (api-type) products report available: null.

Check the wallet

GET https://mail.aishop.bd/api/v1/wallet

curl https://mail.aishop.bd/api/v1/wallet \
  -H "Authorization: Bearer sk-YOUR_KEY"

# β†’ { "object": "wallet", "balance": 42.5, "currency": "USD", "ai_credits": 1000 }

balance is the main USD wallet used for store purchases; ai_credits is what AI requests deduct.

Buy a product

POST https://mail.aishop.bd/api/v1/store/products/{slug}/purchase

Buy the products shown on the website (subscriptions, accounts, license keys) with your wallet balance β€” the same instant-delivery flow as the storefront.

curl https://mail.aishop.bd/api/v1/store/products/chatgpt-plus/purchase \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_price_id": 12,
    "quantity": 1,
    "coupon_code": "SAVE5"
  }'

Response

{
  "object": "store.order",
  "order_no": "ASN-4TZ9WQK2M",
  "status": "completed",
  "product": "ChatGPT Plus",
  "duration": "1 Month",
  "quantity": 1,
  "subtotal": 19.0,
  "discount": 5.0,
  "total": 14.0,
  "currency": "USD",
  "wallet_balance": 36.0,
  "delivery_token": "dt-…",
  "delivery_url": "https://mail.aishop.bd/api/v1/store/delivery/dt-…",
  "delivery_expires_at": "2026-10-06T12:00:00+00:00"
}

Credentials are never part of the purchase response. Reveal them with a second call:

GET https://mail.aishop.bd/api/v1/store/delivery/{delivery_token}

curl https://mail.aishop.bd/api/v1/store/delivery/dt-… \
  -H "Authorization: Bearer sk-YOUR_KEY"

# β†’ the purchased credentials
{ "object": "store.delivery", "order_no": "ASN-…", "status": "completed",
  "credentials": [
    { "product": "ChatGPT Plus", "type": "account",
      "email": "user@example.com", "password": "…" }
  ] }

Order history

GET https://mail.aishop.bd/api/v1/store/orders

curl https://mail.aishop.bd/api/v1/store/orders \
  -H "Authorization: Bearer sk-YOUR_KEY"

# β†’
{ "object": "list", "data": [
  { "order_no": "ASN-4TZ9WQK2M", "status": "completed", "product": "ChatGPT Plus",
    "duration": "1 Month", "quantity": 1, "total": 14.0, "currency": "USD",
    "created_at": "2026-10-05T12:00:00+00:00",
    "detail_url": "https://mail.aishop.bd/api/v1/store/orders/ASN-4TZ9WQK2M" } ] }

GET https://mail.aishop.bd/api/v1/store/orders/{order_no} returns one order with its full credentials array β€” the same reveal as the delivery endpoint, but with no expiry (the My Orders equivalent, always available to the key owner).

  • The delivery token is valid for 24 hours and only works with your own API key. After it expires (410), the credentials stay available in My Orders on the website β€” and via the order-history endpoint above.
  • Coupon codes from the storefront work here too (case-insensitive).
  • Failed orders never debit the wallet β€” stock shortages roll back automatically.
  • Rate limits: catalog/wallet/orders reads 60 per minute, purchases 10 per minute.

Pricing & billing

  • Credits: every AI request β€” chat, images, video, audio β€” deducts AI credits (list USD price Γ— the credits-per-USD rate shown on the credit packages page). x_cost_usd fields stay in USD.
  • Chat: metered per token β€” input and output prices are per 1M tokens (see the table above). Credits are deducted after each response using the upstream-reported usage. Requests your credits clearly can't cover are rejected with 402 before any call is made.
  • Images: flat price Γ— number of images, charged upfront.
  • Video: per-second price (by resolution) Γ— duration, charged upfront.
  • Audio: flat price per generation, charged upfront β€” except dialogue TTS models (e.g. google/gemini-3-8-flash-lite-tts), which are priced from the script length (β‰ˆ the model row's price per 1,000 characters, with a small per-generation minimum).
  • Refunds: if a job fails, the credits are returned automatically (ledger type refund).
  • Buy credits anytime from your wallet page (paid from the main wallet, topped up via the deposit page); every debit appears in the ledger as ai_usage.

Errors

Status Meaning
401Missing or invalid API key.
402Insufficient AI credits β€” buy credits and retry.
404Unknown model, or a job that isn't yours.
422Validation error β€” check the errors field.
429Rate limit exceeded.
503This AI feature is disabled by the administrator.
502Upstream provider failure β€” safe to retry.
{ "error": { "message": "Insufficient AI credits…", "type": "ai_gateway_error" } }

Rate limits

  • Chat endpoints: 60 requests / minute
  • Image & audio generation: 20 requests / minute
  • Video generation: 10 requests / minute

Cline / VS Code setup

Cline (VS Code)

  1. Open Cline settings β†’ API Provider β†’ Anthropic Compatible.
  2. Base URL: https://mail.aishop.bd/api
  3. API key: your sk-… key
  4. Model id: e.g. claude-sonnet-4-6

VS Code (Continue / other OpenAI-compatible tools)

  1. Provider: OpenAI Compatible (or openai).
  2. Base URL: https://mail.aishop.bd/api/v1
  3. API key: your sk-… key
  4. Model id: e.g. gpt-6-luna

Streaming works in both β€” tokens arrive live as they are generated.