GreenPT Docs

Chat Completion

Create a chat completion with the GreenPT model. We recommend gemma4.

Create a chat completion with a GreenPT model. We recommend gemma4: long-context, multimodal, and hosted on sustainable EU infrastructure. See Models for the full list.

POST/v1/chat/completions

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "gemma4",    "messages": [      {        "role": "user",        "content": "Hello, how are you?"      }    ]  }'
{
  "id": "string",
  "object": "chat.completion",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "string",
        "reasoning_content": "string",
        "tool_calls": [
          {}
        ]
      },
      "logprobs": {},
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "type": "string",
    "param": "string"
  },
  "requestId": "string"
}
{
  "error": {
    "code": 0,
    "message": "string",
    "type": "string",
    "param": "string"
  },
  "requestId": "string"
}

Notes

  • Recommended model: gemma4. Other models (e.g. green-l, green-r) are available, see Models.
  • Streaming: set stream: true and consume the response as Server-Sent Events. See Chat Completion (Streaming).
  • Authorization: pass your API key in the Authorization header as Bearer YOUR_API_KEY.
  • Reasoning effort: reasoning_effort is supported on GreenPT-hosted models. Omit it to keep thinking enabled (the default), or pass "none" to disable thinking entirely. OpenAI-spec values (minimal / low / medium / high) are accepted for compatibility and all currently map to thinking-enabled.