๐Ÿ”ฅGodFocus Platformยท Docs
โ† HomeDashboard โ†’

Streaming

The /v1/bible/ask endpoint streams its response as Server-Sent Events (SSE).

Format

Each event is a data: line followed by two newlines. The server sends tokens one at a time, then citations, then a [DONE] signal:

data: {"token": "The"}

data: {"token": " Bible"}

data: {"token": " teaches"}

data: {"citations": [{"reference": "Ephesians 4:32", "text": "Be kind to one another..."}]}

data: [DONE]

Reading the stream

curl -X POST https://platform.godfocus.io/v1/bible/ask \
  -H "Authorization: Bearer $GODFOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  --no-buffer \
  -d '{"question": "What does the Bible say about forgiveness?"}'

Event types

FieldDescription
tokenA single word or word-piece of the answer
citationsArray of {reference, text} objects โ€” sent once before [DONE]

Connection management

Keep the HTTP connection open until you receive data: [DONE]. If the connection drops before [DONE], the answer is incomplete โ€” retry the full request.

Credits are deducted once the stream starts (10 credits per /v1/bible/ask call).