OpenAI SDK Quickstart (DOCS-01)
Point any OpenAI-compatible client at your Yaarbal capsule and get free inference from
a real GPU on the network. No new SDK to learn — the capsule speaks the real
POST /v1/chat/completions (streaming included) and GET /v1/models contract
(rentmygpu/seeder/capsule_routes.py), so this works with openai-python, aider,
Continue, or anything else that already speaks OpenAI's API shape.
Your invite includes your base_url and api_key
There is no self-serve signup or token-minting page in this beta. When you're invited,
the operator sends you your capsule's base_url (already pointed at its /v1 surface)
and your rmgc- API key together, bundled with the invite. Drop both straight into the
snippet below — there's nothing else to provision.
Copy-paste
from openai import OpenAI
client = OpenAI(base_url="<base_url-from-your-invite>", api_key="rmgc-<from-your-invite>")
resp = client.chat.completions.create(
model="<model-name-from-your-invite>",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
That's the whole integration. model is whatever your invite tells you the capsule is
serving — capsules run one curated model at a time.
Notes
- Streaming. Pass
stream=Truetochat.completions.create()— the capsule proxies the real Server-Sent-Events stream byte-faithfully, so streaming clients work unmodified. - List available models.
client.models.list()is backed by the real, Bearer-gatedGET /v1/models— the same token you already have works here too. - Rate limits apply to all requests.
- Credits and access may reset during the beta.
- Terms of Service: https://rmg-web.yaarbal.app/tos
Operator appendix (not the user path)
This section is for the operator provisioning access, not for someone following the quickstart above. Mint a token with:
python -m rentmygpu.cli.capsule_tokens add --peer-id <peer-id> --label <name>
This prints the raw rmgc- token to your terminal exactly once — send it, together with
the capsule's base_url, to the teammate you're inviting. See
docs/CAPSULE-SECURITY.md for the full trust-boundary and token-handling contract before
handing out a token.