API Reference
Access OpenAI and Google Gemini models through one gateway, using the SDKs you already know. Change two lines — the base URL and your key — and you're live.
Quickstart
Install the OpenAI SDK, point it at the AICreditMart endpoint, and use your API key.
from openai import OpenAI client = OpenAI( base_url="https://api.aicreditmart.com/v1/", api_key="YOUR_API_KEY", ) response = client.chat.completions.create( model="gpt-5.4", messages=[{"role": "user", "content": "Hello!"}], ) print(response.choices[0].message.content)
base_url and api_key.Authentication
Pass your API key as the api_key in the SDK client. It's sent as a standard Bearer token and tracks your usage and billing.
api_key = "sk-bf-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Keep your key private. If a key is exposed, contact us to rotate it.
Base URLs
Two endpoints, depending on which SDK you use:
https://api.aicreditmart.com/v1/https://api.aicreditmart.com/genaiUse the OpenAI base URL for all OpenAI models. Use the Gemini base URL with Google's google-genai SDK for Gemini models.
Rate Limits
Rate limits are generous and set per API key. Most workloads run without hitting them. If you expect high sustained throughput or need a dedicated limit, contact us and we'll raise it for your key.
Regions
Models run primarily on US-based infrastructure (Azure US, Google US, and others). If you have data-residency requirements, EU region routing is available on request — contact us to enable it for your key.
Tracking Usage
Every account has a dedicated dashboard with real-time usage and cost tracking, broken down by model, tokens, and spend — so you always know exactly what you're using.
Sign in to view your usage at app.aicreditmart.com.
OpenAI Models
Send the Model ID exactly as shown.
Text & reasoning
| Model ID | Notes |
|---|---|
gpt-5.4 | Affordable model for coding and professional work |
gpt-5.4-mini | Strongest mini for coding and computer use |
gpt-5.4-nano | Cheapest 5.4-class model for high-volume tasks |
gpt-5.2 | Previous frontier model, configurable reasoning |
gpt-5.1 | Strong coding and agentic tasks, configurable reasoning |
gpt-5 | Reasoning model for coding and agentic tasks |
gpt-5-mini | Near-frontier, low-latency, high-volume workloads |
gpt-5-nano | Fastest, most cost-efficient GPT-5 |
gpt-4.1 | Smartest non-reasoning model |
gpt-4.1-mini | Smaller, faster GPT-4.1 |
gpt-4.1-nano | Fastest, most cost-efficient GPT-4.1 |
gpt-4o | Fast, intelligent, flexible multimodal model |
gpt-4o-mini | Fast, affordable model for focused tasks |
Image
| Model ID | Notes |
|---|---|
gpt-image-2 | State-of-the-art image generation |
gpt-image-1.5 | Previous-generation image model |
gpt-image-1-mini | Cost-efficient image generation |
Video
| Model ID | Notes |
|---|---|
sora-2 | Flagship video generation with synced audio |
Embeddings
| Model ID | Notes |
|---|---|
text-embedding-3-large | Most capable embedding model |
text-embedding-3-small | Small, fast embedding model |
Example — Text (gpt-5.4)
from openai import OpenAI client = OpenAI( base_url="https://api.aicreditmart.com/v1/", api_key="YOUR_API_KEY", ) response = client.chat.completions.create( model="gpt-5.4", messages=[{"role": "user", "content": "How far is New York from London?"}], ) print(response.choices[0].message.content) print(f"Tokens used: {response.usage.total_tokens}")
Example — Image (gpt-image-2)
from openai import OpenAI import base64 client = OpenAI( base_url="https://api.aicreditmart.com/v1/", api_key="YOUR_API_KEY", ) response = client.images.generate( model="gpt-image-2", prompt="A majestic horse standing in a field", n=1, size="1024x1024", quality="medium", output_format="png", ) if response.data[0].b64_json: img = base64.b64decode(response.data[0].b64_json) with open("horse.png", "wb") as f: f.write(img) print("Saved horse.png")
Example — Video (sora-2)
import time from openai import OpenAI client = OpenAI( base_url="https://api.aicreditmart.com/v1/", api_key="YOUR_API_KEY", ) # 1. Create the video video = client.videos.create( model="sora-2", prompt="A cat playing piano in a jazz bar", size="1280x720", seconds="4", ) # 2. Poll until complete while video.status in ["queued", "in_progress"]: time.sleep(5) video = client.videos.retrieve(video.id) print(f"Status: {video.status}") # 3. Download if video.status == "completed": content = client.videos.download_content(video.id, variant="video") content.write_to_file("output.mp4") print("Saved output.mp4")
Example — Embeddings (text-embedding-3-small)
from openai import OpenAI client = OpenAI( base_url="https://api.aicreditmart.com/v1/", api_key="YOUR_API_KEY", ) response = client.embeddings.create( model="text-embedding-3-small", input="The quick brown fox jumps over the lazy dog.", ) print(f"Dimensions: {len(response.data[0].embedding)}")
Google Gemini Models
Use Google's google-genai SDK pointed at the Gemini base URL. Send model names with the models/ prefix.
Text
| Model ID | Notes |
|---|---|
gemini-3.5-flash | Most intelligent flash for agentic and coding |
gemini-3.1-pro-preview | Advanced reasoning and agentic coding (preview) |
gemini-3.1-flash-lite | Frontier-class performance at low cost |
gemini-3-flash-preview | Frontier-class performance, low cost (preview) |
gemini-2.5-pro | Advanced reasoning and coding for complex tasks |
gemini-2.5-flash | Best price-performance for high-volume reasoning |
gemini-2.5-flash-lite | Fastest, most budget-friendly 2.5 model |
Image
| Model ID | Notes |
|---|---|
gemini-3-pro-image | Studio-quality 4K image generation and editing |
gemini-3.1-flash-image | High-efficiency image generation, optimized for speed |
gemini-2.5-flash-image | Native image generation for fast creative workflows |
Example — Text (gemini-3.5-flash)
from google import genai from google.genai import types client = genai.Client( api_key="YOUR_API_KEY", http_options=types.HttpOptions(base_url="https://api.aicreditmart.com/genai"), ) response = client.models.generate_content( model="models/gemini-3.5-flash", contents="Tell me about London in one sentence.", ) print(response.text)
Example — Image (gemini-3.1-flash-image)
from google import genai from google.genai import types client = genai.Client( api_key="YOUR_API_KEY", http_options=types.HttpOptions(base_url="https://api.aicreditmart.com/genai"), ) MODEL = "gemini-3.1-flash-image" r = client.models.generate_content( model=f"models/{MODEL}", contents="A photorealistic golden retriever wearing a red cape, studio lighting", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) for part in r.candidates[0].content.parts: if part.inline_data and part.inline_data.data: with open(f"{MODEL}.png", "wb") as f: f.write(part.inline_data.data) print(f"Saved {MODEL}.png")
image_config=types.ImageConfig(image_size="4K") inside the config for up to 4K (on gemini-3.1-flash-image and gemini-3-pro-image).