v3

latestOpenAPI 3.1.02026-07-311,4541,5202.3 MB
logs

Api Request Logs Create Create

Centralized respan_params initialization and backward-compat layer.

This mixin is the SINGLE initialization point for respan_params. It runs _initialize_respan_params() BEFORE super().initial() so that by the time the throttle runs, respan_params is a fully resolved dict. Downstream code (throttle, preprocessing, view handler) only enriches the existing dict — they never need to create it.

Initialization order::

_initialize_respan_params()   ← legacy rename + header parse + metadata
    ↓
super().initial()             ← throttle ENRICHES the existing dict
    ↓
view handler                  ← billing, security strip, etc.

Responsibilities consolidated here (previously scattered across 4 callsites):

  1. Legacy header rename (X-Data-Keywordsai-Params → X-Data-Respan-Params)
  2. Parse X-Data-Respan-Params header (base64 → dict)
  3. Legacy body rename (keywordsai_params → respan_params)
  4. Form data handling (JSON string → dict)
  5. Metadata nesting (passthrough endpoints — Anthropic, Google, etc.)
  6. Merge: {**header_params, **body_params} (body wins on field conflict)
  7. Add request_url_path from request.META['PATH_INFO']
  8. Guarantee request.data[RESPAN_PARAMS_KEY] is always a dict

Safe for protobuf endpoints: body adaptation is skipped when request.data is not a dict; header adaptation always runs.

Usage::

class MyChatView(AdaptRespanParamsMixin, APIView):
    ...
post/api/request-logs/create/

Headers

Authorizationstring required

JWT access token or Respan API key

Request body

ip_addressstring nullable
pre_commit_idstring nullable
custom_identifierstring nullable
group_identifierstring nullable
blurredboolean nullable
hour_groupstring date-time
minute_groupstring date-time
start_timestring date-time nullable
timestampstring date-time
load_balance_group_idstring
unique_idstring nullable
mapped_model_namestring
response_format_choicestring nullable
parallel_tool_callsboolean nullable
prompt_tokensinteger
completion_tokensinteger
prompt_cache_hit_tokensinteger nullable
prompt_cache_creation_tokensinteger nullable
total_request_tokensinteger
costnumber double
inputstring
input_arraystring[] nullable
encoding_formatstring
dimensionsinteger nullable
embeddingnumber[] nullable
base64_embeddingstring nullable
audio_input_filestring binary nullable
transcriptionstring
audio_response_formatstring
audio_output_filestring binary nullable
{"stackTrail":"components:schemas:RequestLogCreateRequest:properties:completion_message","oasType":"schema","type":"unknown","description":"Any type"}
latencynumber double nullable
modelstring
calling_modelstring nullable
foundation_modelstring
provider_idstring
full_model_namestring nullable
has_tool_callsboolean
categorystring
time_to_first_tokennumber double nullable
routing_timenumber double
notestring
session_idstring
{"stackTrail":"components:schemas:RequestLogCreateRequest:properties:metadata","oasType":"schema","type":"unknown","description":"Any type"}
metadata_indexed_string_1string nullable
metadata_indexed_string_2string nullable
metadata_indexed_numerical_1number double nullable
cachedboolean
cache_bitinteger
cache_miss_bitinteger nullable
cache_keystring nullable
positive_feedbackboolean nullable
tokens_per_secondnumber double
{"stackTrail":"components:schemas:RequestLogCreateRequest:properties:full_request","oasType":"schema","type":"unknown","description":"Any type"}
{"stackTrail":"components:schemas:RequestLogCreateRequest:properties:full_response","oasType":"schema","type":"unknown","description":"Any type"}
status_codeinteger
warningsstring
recommendationsstring nullable
has_warningsboolean
error_messagestring
is_exampleboolean
is_maliciousboolean
log_method'inference' | 'logging_api' | 'batch' | 'python_tracing' | 'ts_tracing' | 'tracing_integration'
  • inference - Inference
  • logging_api - Logging Api
  • batch - Batch
  • python_tracing - Python Tracing
  • ts_tracing - Ts Tracing
  • tracing_integration - Tracing Integration
log_type'text' | 'chat' | 'completion' | 'response' | 'embedding' | 'transcription' | 'speech' | 'workflow' | 'task' | 'tool' | 'agent' | 'handoff' | 'guardrail' | 'function' | 'custom' | 'generation' | 'unknown' | 'score' | 'batch' | 'span'
  • text - Text
  • chat - Chat
  • completion - Completion
  • response - Response
  • embedding - Embedding
  • transcription - Transcription
  • speech - Speech
  • workflow - Workflow
  • task - Task
  • tool - Tool
  • agent - Agent
  • handoff - Handoff
  • guardrail - Guardrail
  • function - Function
  • custom - Custom
  • generation - Generation
  • unknown - Unknown
  • score - Score
  • batch - Batch
  • span - Span
failedboolean
error_bitinteger
is_testboolean
streamboolean
temperaturenumber double nullable
max_tokensinteger nullable
logprobsboolean nullable
top_logprobsinteger nullable
frequency_penaltynumber double nullable
presence_penaltynumber double nullable
stopstring nullable
ninteger nullable
evaluation_identifierstring nullable
is_datasetboolean
based_log_unique_idstring nullable
customer_identifierstring
customer_emailstring email
customer_namestring
customer_user_unique_idstring nullable
used_custom_credentialboolean
deployment_namestring
custom_endpointstring nullable
custom_regionstring nullable
prompt_namestring nullable
prompt_idstring
prompt_version_numberinteger nullable
covered_by'own_credential' | 'user' | 'credits' | 'credit_and_credential' | 'cache_hit' | 'credit_and_cache'
  • own_credential - Own Credential
  • user - User
  • credits - Credits
  • credit_and_credential - Credit And Credential
  • cache_hit - Cache Hit
  • credit_and_cache - Credit And Cache
system_textstring nullable
prompt_textstring nullable
completion_textstring nullable
system_text_vectorstring nullable
prompt_text_vectorstring nullable
completion_text_vectorstring nullable
full_text_indexedboolean
trace_unique_idstring nullable
span_unique_idstring nullable
trace_group_identifierstring nullable
span_namestring nullable
span_handoffsstring[] nullable
span_toolsstring[] nullable
span_parent_idstring nullable
span_pathstring nullable
span_workflow_namestring nullable
outputstring nullable
thread_identifierstring
thread_unique_idstring nullable
storage_object_keystring nullable
error_message_searchstring nullable
evaluation_costnumber double
LLM_based_context_precisionnumber double nullable
LLM_based_faithfulnessnumber double nullable
flesch_reading_easenumber double nullable
flesch_kincaid_grade_levelnumber double nullable
LLM_based_answer_relevancenumber double nullable
amount_to_paynumber double nullable
full_cost_calculatedboolean nullable
stripe_usage_report_sentboolean nullable
to_update_threadboolean nullable
to_update_customer_userboolean nullable
organizationinteger nullable
company_organizationinteger nullable
userinteger nullable
organization_keystring nullable
customer_userinteger nullable
prompt_versioninteger nullable
threadinteger nullable
traceinteger nullable
spaninteger nullable

Response

idinteger required
ip_addressstring nullable
pre_commit_idstring nullable
custom_identifierstring nullable
group_identifierstring nullable
blurredboolean nullable
hour_groupstring date-time
minute_groupstring date-time
start_timestring date-time nullable
timestampstring date-time
load_balance_group_idstring
unique_idstring nullable
mapped_model_namestring
response_format_choicestring nullable
parallel_tool_callsboolean nullable
prompt_tokensinteger
completion_tokensinteger
prompt_cache_hit_tokensinteger nullable
prompt_cache_creation_tokensinteger nullable
total_request_tokensinteger
costnumber double
inputstring
input_arraystring[] nullable
encoding_formatstring
dimensionsinteger nullable
embeddingnumber[] nullable
base64_embeddingstring nullable
audio_input_filestring uri nullable
transcriptionstring
audio_response_formatstring
audio_output_filestring uri nullable
{"stackTrail":"components:schemas:RequestLogCreate:properties:completion_message","oasType":"schema","type":"unknown","description":"Any type"}
latencynumber double nullable
modelstring
calling_modelstring nullable
foundation_modelstring
provider_idstring
full_model_namestring nullable
has_tool_callsboolean
categorystring
time_to_first_tokennumber double nullable
routing_timenumber double
notestring
session_idstring
{"stackTrail":"components:schemas:RequestLogCreate:properties:metadata","oasType":"schema","type":"unknown","description":"Any type"}
metadata_indexed_string_1string nullable
metadata_indexed_string_2string nullable
metadata_indexed_numerical_1number double nullable
cachedboolean
cache_bitinteger
cache_miss_bitinteger nullable
cache_keystring nullable
positive_feedbackboolean nullable
tokens_per_secondnumber double
{"stackTrail":"components:schemas:RequestLogCreate:properties:full_request","oasType":"schema","type":"unknown","description":"Any type"}
{"stackTrail":"components:schemas:RequestLogCreate:properties:full_response","oasType":"schema","type":"unknown","description":"Any type"}
status_codeinteger
warningsstring
recommendationsstring nullable
has_warningsboolean
error_messagestring
is_exampleboolean
is_maliciousboolean
log_method'inference' | 'logging_api' | 'batch' | 'python_tracing' | 'ts_tracing' | 'tracing_integration'
  • inference - Inference
  • logging_api - Logging Api
  • batch - Batch
  • python_tracing - Python Tracing
  • ts_tracing - Ts Tracing
  • tracing_integration - Tracing Integration
log_type'text' | 'chat' | 'completion' | 'response' | 'embedding' | 'transcription' | 'speech' | 'workflow' | 'task' | 'tool' | 'agent' | 'handoff' | 'guardrail' | 'function' | 'custom' | 'generation' | 'unknown' | 'score' | 'batch' | 'span'
  • text - Text
  • chat - Chat
  • completion - Completion
  • response - Response
  • embedding - Embedding
  • transcription - Transcription
  • speech - Speech
  • workflow - Workflow
  • task - Task
  • tool - Tool
  • agent - Agent
  • handoff - Handoff
  • guardrail - Guardrail
  • function - Function
  • custom - Custom
  • generation - Generation
  • unknown - Unknown
  • score - Score
  • batch - Batch
  • span - Span
failedboolean
error_bitinteger
is_testboolean
streamboolean
temperaturenumber double nullable
max_tokensinteger nullable
logprobsboolean nullable
top_logprobsinteger nullable
frequency_penaltynumber double nullable
presence_penaltynumber double nullable
stopstring nullable
ninteger nullable
evaluation_identifierstring nullable
is_datasetboolean
based_log_unique_idstring nullable
customer_identifierstring
customer_emailstring email
customer_namestring
customer_user_unique_idstring nullable
used_custom_credentialboolean
deployment_namestring
custom_endpointstring nullable
custom_regionstring nullable
prompt_namestring nullable
prompt_idstring
prompt_version_numberinteger nullable
covered_by'own_credential' | 'user' | 'credits' | 'credit_and_credential' | 'cache_hit' | 'credit_and_cache'
  • own_credential - Own Credential
  • user - User
  • credits - Credits
  • credit_and_credential - Credit And Credential
  • cache_hit - Cache Hit
  • credit_and_cache - Credit And Cache
system_textstring nullable
prompt_textstring nullable
completion_textstring nullable
system_text_vectorstring nullable
prompt_text_vectorstring nullable
completion_text_vectorstring nullable
full_text_indexedboolean
trace_unique_idstring nullable
span_unique_idstring nullable
trace_group_identifierstring nullable
span_namestring nullable
span_handoffsstring[] nullable
span_toolsstring[] nullable
span_parent_idstring nullable
span_pathstring nullable
span_workflow_namestring nullable
outputstring nullable
thread_identifierstring
thread_unique_idstring nullable
storage_object_keystring nullable
error_message_searchstring nullable
evaluation_costnumber double
LLM_based_context_precisionnumber double nullable
LLM_based_faithfulnessnumber double nullable
flesch_reading_easenumber double nullable
flesch_kincaid_grade_levelnumber double nullable
LLM_based_answer_relevancenumber double nullable
amount_to_paynumber double nullable
full_cost_calculatedboolean nullable
stripe_usage_report_sentboolean nullable
to_update_threadboolean nullable
to_update_customer_userboolean nullable
organizationinteger nullable
company_organizationinteger nullable
userinteger nullable
organization_keystring nullable
customer_userinteger nullable
prompt_versioninteger nullable
threadinteger nullable
traceinteger nullable
spaninteger nullable