SubToAPI Claude HTTPS API Setup Guide
If you're searching for a SubToAPI Claude HTTPS API setup guide, you're probably trying to turn your Claude access into something you can actually call from code — a real HTTPS endpoint with an API key, instead of a browser tab you have to babysit. This guide walks through the exact setup: signing up, generating a key, making your first request, and wiring in streaming or tool use.
The short version: SubToAPI sits between your Claude access and your application, exposing a standard HTTPS API at https://api.subtoapi.app/v1/... secured with an application-level key (sub_live_...). You authenticate with a Bearer token, send JSON, get JSON (or a stream) back. No browser automation, no fragile session cookies — just an API you can call from any language or framework.
Step 1: Create your account and get a key
Start at /signup. SubToAPI runs a free trial, so you can complete the full setup before committing to a plan. Once you're in, the dashboard gives you an application key that looks like sub_live_xxxxxxxxxxxx. This key is what authenticates every request — treat it like any other production secret:
- Don't commit it to git.
- Store it in an environment variable (
SUBTOAPI_KEY). - Rotate it from the dashboard if you suspect it leaked.
If you're setting this up for a team rather than a solo project, note that keys are scoped per seat under the Team (€19/seat) or Scale (€49/seat) plans, so each developer or environment can have its own key without sharing credentials. Solo projects can run on the €9 plan. Full breakdown is on /pricing.
Step 2: Make your first HTTPS call
With the key in hand, the fastest way to confirm everything works is a plain curl request against the messages endpoint:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 256,
"messages": [
{ "role": "user", "content": "Say hello in one sentence." }
]
}'
A successful response returns a JSON object with the model's reply plus usage metadata (input/output token counts), which is useful for tracking cost per request without digging through separate billing dashboards. If you get an auth error, double-check the key is set correctly in your shell:
echo $SUBTOAPI_KEY
The full request/response schema is documented at /docs/messages, and a condensed walkthrough of this exact flow lives at /docs/quickstart if you want a reference while building.
Step 3: Call it from your application code
Once the curl test works, move the same call into your app. Here's a minimal Node.js example using fetch:
const response = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "claude-sonnet-4-5",
max_tokens: 512,
messages: [
{ role: "user", content: "Summarize the setup steps above in 3 bullets." },
],
}),
});
const data = await response.json();
console.log(data);
Because this is a standard HTTPS endpoint, it works the same way in Python (requests/httpx), Go, Ruby, or any serverless function — there's no SDK lock-in requirement. If your stack already has an HTTP client, you have everything you need.
Step 4: Add streaming for real-time output
For chat UIs or anything where you want tokens to appear as they're generated rather than waiting for the full response, enable streaming by setting "stream": true in the request body. The response comes back as server-sent events you read incrementally instead of parsing one JSON blob:
const response = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "claude-sonnet-4-5",
max_tokens: 512,
stream: true,
messages: [{ role: "user", content: "Write a short changelog entry." }],
}),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
process.stdout.write(decoder.decode(value));
}
The event format and chunk structure are detailed at /docs/streaming. This is the setup you want for chatbots, live editors, or any UI where latency to first token matters more than total completion time.
Step 5: Set up tool use (if your app needs it)
If your application needs Claude to call functions — looking up data, hitting an internal API, running a calculation — define tools in the request and handle the tool_use response the same way you would with any function-calling setup. SubToAPI passes through tool definitions and tool results without extra wrapping, so existing tool-use code generally ports over with just the endpoint and key swapped. Schema and examples are at /docs/tools.
Common setup mistakes to avoid
- Hardcoding the key in client-side code. Application keys belong in server-side environment variables or secret managers, never in frontend bundles.
- Skipping the trial test call. Run the curl example above before building anything on top — it isolates auth issues from app-logic issues.
- Mixing up seat-based keys. On Team/Scale plans, make sure each environment (dev, staging, prod) uses its own key so usage metadata stays meaningful per context.
- Ignoring usage metadata. Every response includes token counts — log them early so you're not surprised by cost later.
Once the first request works, the rest of the setup is just repetition: add streaming where you need responsiveness, add tools where you need actions, and add seats as your team grows.
questions
Do I need to install an SDK to use SubToAPI? No. SubToAPI is a standard HTTPS JSON API, so any HTTP client in any language works. SDKs may simplify things, but a plain fetch or curl call is enough to get started.
Can I test SubToAPI before paying? Yes. Signing up at /signup starts a free trial, which is enough to complete the full setup — key creation, first request, streaming, and tool use — before choosing a plan on /pricing.
What's the difference between Solo, Team, and Scale plans for API setup? The HTTPS API setup itself is identical across plans. The difference is seats: Solo (€9) is for one key/user, while Team (€19/seat) and Scale (€49/seat) let multiple developers each hold their own key under one dashboard with shared usage visibility.