Skip to main content
GET
Retrieve log
The Get Log endpoint allows you to retrieve complete information about a specific log by its unique ID, including:
  • Full input/output content (input and output fields)
  • Type-specific fields extracted based on log_type
  • Credit and budget check results (limit_info)
  • Evaluation scores
  • Complete request/response metadata

Response fields

Each log in the response includes:

Universal fields (All Span Types)

  • input (string): JSON-serialized representation of the span’s input data
  • output (string): JSON-serialized representation of the span’s output data
  • log_type (string): Type of span ("chat", "embedding", "workflow", etc.)

Legacy compatibility

For log_type="chat", "completion", "text", or "response":
  • prompt_messages (array): Full input messages array (extracted from input)
  • completion_message (object): Full output message object (extracted from output)
For other span types (embedding, workflow, etc.), type-specific fields are extracted based on the log_type. See log types for details.
You should first get the log list, and based on the unique_id in the list, retrieve the specific log. Learn more about the log list endpoint.

Credit and Budget Information

Every log includes credit and budget check information in the keywordsai_params.limit_info field (available in the detail endpoint only).

What is limit_info?

When you make an LLM request, Keywords AI checks:
  1. Organization Credits: Your organization’s remaining credit balance
  2. Customer Budgets: Per-customer spending limits (if configured)
The limit_info object shows the results of these checks.

Structure

Fields Explained

  • is_allowed: Whether the request was allowed to proceed (all limits passed)
  • limits: Array of individual limit check results
    • name: Type of limit - "org_credits" or "customer_budget"
    • current_value: Balance before this request (USD)
    • new_value: Balance after this request (USD)
    • limit_value: Minimum required balance (USD)
    • is_within_limit: Whether this specific check passed

Use Cases

  • Monitor spending: Track credit usage per request
  • Debug rejections: Understand why a request was blocked
  • Customer analytics: Analyze per-customer spending patterns
  • Budget alerts: Build custom alerts when approaching limits
Request succeeded. Organization had 50incredits,nowhas50 in credits, now has 49.98 after this $0.02 request.
Request blocked. Customer has used 9.99oftheir9.99 of their 10 budget, not enough for this request.

Path parameters

string
required
The unique ID of the log to get.