LLM

Generate chat completion

Send messages to an LLM and receive a completion. Requires authenticated user with active organization. Usage is tracked for auditing and future quota enforcement.

Message Roles:

  • system: Defines the AI's behavior and constraints (e.g., "You are a helpful coding assistant"). Place at the beginning of the conversation. Only one system message is supported (Gemini limitation).
  • user: Represents the human's questions or requests. Can appear multiple times in the conversation.
  • assistant: Represents the AI's previous responses. Used to maintain conversation history and context.

Example conversation flow:

{
  "messages": [
    {"role": "system", "content": "You are a helpful assistant that responds in French."},
    {"role": "user", "content": "What is the capital of France?"},
    {"role": "assistant", "content": "La capitale de la France est Paris."},
    {"role": "user", "content": "What is its population?"}
  ]
}

The AI will remember the conversation context and respond about Paris's population.

post/v1/llm/chat/completions

Request

  • Base URL: https://api.prod.keyban.io
  • URL: https://api.prod.keyban.io/v1/llm/chat/completions
  • Auth: one of:
    • API key in header X-Api-Key
    • bearer (a scheme the document does not define)

Request body

applicationstring uuid required

Application ID for usage tracking

provider'GOOGLE'

LLM provider to use (GOOGLE for MVP)

modelstring required

Model identifier (e.g., gemini-2.5-flash-lite)

temperaturenumber

Sampling temperature (0=deterministic, 2=creative). Optional.

maxTokensinteger

Maximum tokens in response (up to 8192). Optional.

topPnumber

Nucleus sampling parameter. Optional.

topKinteger

Top-K sampling parameter. Optional.

Response

Chat completion generated successfully

idstring uuid required

Unique identifier for this completion

provider'GOOGLE' required

Provider that generated this

modelstring required

Model that generated this response

finishReasonstring required

Reason completion finished (stop, length, etc.)

createdAtstring date-time required

Timestamp of completion

Changes

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