AI

Chat completions (OpenAI-compatible)

OpenAI-compatible chat completions endpoint. Use your Blink workspace API key (or, from a Blink backend, the backend AI key env.BLINK_BACKEND_AI_KEY) in place of an OpenAI key. The default model is anthropic/claude-sonnet-4.6. response_format: { type: "json_object" } is silently converted to no format constraint — use json_schema instead. For streaming requests, stream_options.include_usage is injected automatically.

post/api/v1/ai/chat/completions

Request

  • Base URL
    https://core.blink.new
  • URL
    https://core.blink.new/api/v1/ai/chat/completions
  • Auth
    • HTTP bearer
    • or HTTP bearer

Request body

modelstring

Model identifier (gateway format provider/model)

streamboolean

Enable SSE streaming (text/event-stream)

temperaturenumber
max_tokensinteger
top_pnumber
toolsobject[]

Function/tool definitions (OpenAI tool calling spec)

Example request

{
  "model": "anthropic/claude-haiku-4.5",
  "messages": [
    {
      "content": [
        {
          "image": "https://example.com/image.jpg"
        }
      ]
    }
  ]
}

Response

Chat completion response (OpenAI format). When stream: true, returns text/event-stream SSE data ending with [DONE].

idstring
objectstring
createdinteger
modelstring

Example response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1694268190,
  "model": "claude-sonnet-4-6-20250514",
  "choices": [
    {
      "message": {
        "content": [
          {
            "image": "https://example.com/image.jpg"
          }
        ]
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.