ChatGPT Lite Proxy API Docs

Back to Chat UI

This proxy exposes a stateless chat completion gateway to OpenAI's anonymous API. It tracks no sessions on the server side and forwards chat histories by accepting conversation pointers directly from the client.

Authentication

All HTTP API requests must include the API key. Include it using either of the following HTTP headers:

x-api-key: <YOUR_API_KEY>
# OR
Authorization: Bearer <YOUR_API_KEY>
POST /chat

Request Parameters

Parameter Type Required Description
message string Required The text prompt input from the user.
conversation_id string (UUID) Optional The existing conversation UUID. Omit or pass null to start a new chat.
parent_message_id string (UUID) Optional The UUID of the last assistant response message in this conversation.
stream boolean Optional Whether to stream response tokens. Defaults to false.

Non-Streaming Response (stream: false)

Returns a standard JSON payload once the full assistant response is generated.

{
  "response": "Hello! How can I help you today?",
  "conversation_id": "6a4fa50e-88a4-83ea-ab5a-3c922477409f",
  "parent_message_id": "2efc0562-d140-4b61-9ffd-2e6324ead651",
  "model": "gpt-5-5",
  "title": "Greeting Request"
}

Streaming Response (stream: true)

Returns a text/event-stream where each chunk line begins with data: followed by a JSON object. We use Event Types to simplify streaming data and avoid duplicates:

text Text Chunk Delta

Fired repeatedly to transmit the generated response tokens. Empty text deltas are never output.

data: {"type": "text", "content": "Hello"}
session Session Identifiers

Sent exactly once as soon as the session IDs are resolved by the backend. The client must store these to carry context into follow-up prompts.

data: {
  "type": "session",
  "conversation_id": "6a4fa518-0604-83ea-a95d-7cdd125743a9",
  "parent_message_id": "2efc0562-d140-4b61-9ffd-2e6324ead651"
}
metadata Model & Chat Details

Sent exactly once when model matching and thread title generation complete on OpenAI's server.

data: {
  "type": "metadata",
  "model": "gpt-5-5",
  "title": "Secret Code Reminder"
}
done Stream Finished Indicator

Fired once as the final message to signify the end of transmission.

data: {"type": "done"}
error Error Details

Fired if any communication or gateway failure occurs during execution.

data: {
  "type": "error",
  "error": "OpenAI returned status code 400",
  "detail": "..."
}