Our API speaks the same format as OpenAI's — if you've built against that before, you already know most of this. This page covers the parts specific to us: the endpoint, what's yours to control, and how billing actually works.
Every request is a POST to /v1/chat/completions on your Base URL, with your API key as a bearer token. Your dashboard has both ready to copy.
curl https://api.virtual.sex/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eros",
"messages": [
{ "role": "user", "content": "Say hello." }
],
"stream": false
}'
The response is a standard OpenAI-shape chat completion object — choices[0].message.content,
a usage block with token counts, the works. Set "stream": true for
server-sent-events streaming instead, same as OpenAI's own API.
Anything that shapes how the model samples its output is respected exactly as sent — we don't clamp or second-guess it.
A 401 means a missing or invalid key. A 402 means the balance is at zero — top up and retry. A 502 means something failed upstream; you're not charged for those. Every successful request is billed for the tokens actually used, prompt and completion, reflected in your dashboard balance right away.
Stopping a reply early still bills fairly. If your client cancels a streaming request partway through, you're only charged for what was actually generated up to that point — never the full reply.
1M tokens. Send as much history as your use case needs — if a request ever comes in over budget, the oldest messages are trimmed automatically rather than the request failing.
60 requests per minute per key. That's well beyond any normal back-and-forth conversation; it's there to catch runaway loops and misbehaving clients, not real usage. If you're planning high-volume or production traffic, email us first so we can make sure it goes smoothly.
Yes — that's the point of being OpenAI-compatible. Point it at our Base URL with your API key and it should work the same way it does against OpenAI's own endpoint.
Double-check the Base URL and key for stray spaces, and confirm your dashboard shows a positive balance — that covers most cases. Anything else, email contact@virtual.sex.