Understanding price claude vs our prepaid model
Claude API pricing relies on a tiered subscription model that requires upfront monthly commitments. You pay for access to the platform regardless of how much you actually use the service. This structure can lead to wasted budget if your project has sporadic traffic patterns. Our prepaid model charges strictly by token usage. You only pay for what you consume. This transparency allows you to predict costs with high precision. The cost is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors do not incur charges. Refusals are free. This contrasts sharply with the fixed monthly fees of other providers.
Step 1: Swap your base URL endpoint
Begin by updating your client configuration to point to our base URL. The endpoint is HTTPS://api.glmapiprice.com/v1. This change ensures your requests reach our uncensored model servers. You do not need to alter your authentication headers. The standard Authorization header remains valid. This single change redirects your traffic to our infrastructure. Existing OpenAI SDKs will recognize this URL pattern immediately. No additional libraries are required for this step.
curl https://api.glmapiprice.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Calculate cost for 50k tokens at current rate"}]
}'
Step 2: Update your API key
Generate a new API key from our dashboard. The key is displayed immediately upon creation. Use this key in your Authorization header. The key is specific to your account. It does not expire unless you regenerate it. Our system supports one active key per account. A new key replaces the old one instantly. This ensures clean security boundaries. You can rotate keys without downtime. The key grants access to the chat-completions endpoint only.
from openai import OpenAI
client = OpenAI(base_url="https://api.glmapiprice.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)
Step 3: Verify streaming and JSON responses
Test your integration by sending a request with streaming enabled. The API returns Server-Sent Events. Each chunk contains partial token data. The final chunk includes total token usage. This allows real-time UI updates. JSON mode is also supported. Set the response_format to json_object. The model will return strictly valid JSON. This is crucial for parsing in automated pipelines. Errors during streaming are handled gracefully. The connection closes cleanly. You can trust the reliability of these streams.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.glmapiprice.com/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);
Cost calculation: input vs output tokens
Calculate your costs by summing input and output tokens. Input tokens cost $0.15 per million. Output tokens cost $0.50 per million. The ratio is 1:3.33. This means output is significantly more expensive. Context windows up to 100,000 tokens are supported. However, max output is 16,000 tokens per request. If you do not set max_tokens, the limit is 2,048 tokens. Long outputs increase costs rapidly. Monitor your token usage closely. The API returns usage stats in the response. This helps you stay within budget.
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Handling function calling in your client
Our API supports function calling via tools. Define your functions in the tools array. The model will return tool calls in the response. Parse these calls and execute them. Then send the results back to the model. This enables complex multi-step workflows. The API handles tool_choice automatically. You can force specific tools if needed. This feature is compatible with OpenAI SDKs. It works seamlessly with streaming responses. Function calling is essential for advanced agents.
Monitoring usage and token limits
Track your usage via the API response headers. Each request returns token counts. You can monitor this in your application logs. Rate limits are 300 requests per minute per key. You can have 8 concurrent requests. The request body limit is 8 MB. These limits prevent abuse. They ensure fair usage for all users. If you exceed the limit, you get a 429 error. Wait a few seconds and retry. This is standard behavior for high-traffic APIs. Monitoring helps you optimize your prompt design.
Why prepaid credit beats subscriptions
Prepaid credit eliminates the risk of overpaying. You top up with crypto only. USDT on TRC20 or USDC on Base are accepted. Minimum top-up is $20. Maximum is $500. Bonus credits are available for larger amounts. +5% bonus from $50. +10% from $100. +15% from $200. Credit never expires. This is a significant advantage over subscriptions. You pay exactly what you use. No hidden fees. No monthly renewals. This model is transparent and predictable.