Inference API (OpenAI-compatible)

Green Compute serves open models behind an OpenAI-compatible API. Any OpenAI SDK or tool works once you change the base URL and key.

  • Base URL: https://api.green-compute.com/v1
  • Auth: Authorization: Bearer <your API key>

List models

curl -s https://api.green-compute.com/v1/models -H "Authorization: Bearer $GC_KEY"

Use an id from this list verbatim as model. Per-token prices for each listed model are in GET https://api.green-compute.com/platform/pricing (public).

Chat completions

curl -s https://api.green-compute.com/v1/chat/completions \
  -H "Authorization: Bearer $GC_KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "<id from /v1/models>",
    "messages": [{"role": "user", "content": "Say hello in five words."}],
    "max_tokens": 200
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.green-compute.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
    model="<id from /v1/models>",
    messages=[{"role": "user", "content": "Say hello in five words."}],
    max_tokens=200,
)
print(resp.choices[0].message.content)

Streaming

Set "stream": true. Responses are standard server-sent events, ending with data: [DONE]. The final chunk carries usage. If you disconnect mid-stream, you are billed only for the tokens actually generated.

Tool calling

Standard OpenAI tools / tool_choice are passed through. tool_calls come back in the usual place on the message.

Reasoning models

Some models think before answering. For those:

  • the thinking arrives in message.reasoning_content (not reasoning) and the answer in message.content;
  • thinking counts against max_tokens, so budget generously (2000+). If content comes back empty, the model ran out of budget while thinking; raise max_tokens and retry.

Using it from coding tools

Any tool that accepts a custom OpenAI base URL works:

SettingValue
Base URLhttps://api.green-compute.com/v1
API keyyour Green Compute key
Modelan id from /v1/models

Your own models

A model you deploy yourself (Models → Deploy in the dashboard) also gets its own address, shown on its page:

https://<name>.inference.green-compute.com/v1

Use it as the base URL in any OpenAI client, with your API key as usual. Requests sent there always go to that model, so the model field doesn't decide where they're routed (send the model's name anyway). The same model also answers at https://api.green-compute.com/v1 with model set to its name.

The address is assigned when you create the model and stays the same across redeploys. It answers once a deployment is ready. A private model only accepts keys from your account and any account you've shared it with; the address doesn't make it public.

Your own model is charged by the hour while it runs, like a GPU rental ($0.40 an hour on one RTX 4090), and requests to it aren't charged per token. It pauses after 30 minutes with no requests; a paused model costs nothing. See Pricing.

curl https://<name>.inference.green-compute.com/v1/chat/completions \
  -H "Authorization: Bearer $GC_KEY" -H "Content-Type: application/json" \
  -d '{"model": "<model name>", "messages": [{"role": "user", "content": "Hello"}]}'

Over the API, the address is the workload's ingress_host, and a ready deployment's endpoint is its base URL.

Billing

Shared models: per token, input and output priced separately, with a small minimum charge per request. See GET /platform/pricing for the live figures.

Your own (private) models: by the hour while they run, billed per minute, with no per-token charge. See Pricing.