Documentation v1 · UPDATED 21 AUG 2026
Get an API key

Response consumption

POST /v1/chat/completions returns an OpenAI chat.completion object. Read it the same way you read OpenAI. Fields:

fieldtypenotes
idstringCompletion identifier
objectstringTypically "chat.completion"
createdintegerUnix timestamp (seconds)
modelstringModel that produced the completion
choices[]arrayEach item has index, message, finish_reason
usageobject, optionalprompt_tokens, completion_tokens, total_tokens
from token_gateway import BuyerAuth, BuyerTokenGateway

gw = BuyerTokenGateway("http://127.0.0.1:8080", buyer=BuyerAuth("sk-buyer"))
completion = gw.chat_completions(
    model="gpt-4",
    messages=[{"role": "user", "content": "hello"}],
)
content = completion.choices[0].message.content
print(content)

Set stream: true on the request for server-sent events. End-to-end SSE consumption is on the buyer flow.