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): ...

Authentication

AuthorizationBearer
JWT access token or Respan API key

Request

This endpoint expects an object.
ip_addressstring or nullOptional<=100 characters
pre_commit_idstring or nullOptional<=120 characters
custom_identifierstring or nullOptional<=120 characters
group_identifierstring or nullOptional<=120 characters
blurredboolean or nullOptional
hour_groupdatetimeOptional
minute_groupdatetimeOptional
start_timedatetime or nullOptional
timestampdatetimeOptional
load_balance_group_idstringOptional<=100 characters
unique_idstring or nullOptional1-100 characters
mapped_model_namestringOptional<=255 characters
response_formatanyOptional
response_format_choicestring or nullOptional<=100 characters
parallel_tool_callsboolean or nullOptional
prompt_tokensintegerOptional-2147483648-2147483647
completion_tokensintegerOptional-2147483648-2147483647
prompt_cache_hit_tokensinteger or nullOptional-2147483648-2147483647
prompt_cache_creation_tokensinteger or nullOptional-2147483648-2147483647
total_request_tokensintegerOptional-2147483648-2147483647
costdoubleOptional
inputstringOptional
input_arraylist of strings or nullOptional
encoding_formatstringOptional<=100 characters
dimensionsinteger or nullOptional-2147483648-2147483647
embeddinglist of doubles or nullOptional
base64_embeddingstring or nullOptional
audio_input_filestring or nullOptionalformat: "binary"
transcriptionstringOptional
audio_response_formatstringOptional<=100 characters
audio_output_filestring or nullOptionalformat: "binary"
prompt_messageslist of anyOptional
completion_messageanyOptional
completion_messageslist of any or nullOptional
latencydouble or nullOptional
modelstringOptional<=100 characters
calling_modelstring or nullOptional<=100 characters
foundation_modelstringOptional<=100 characters
provider_idstringOptional<=100 characters
full_model_namestring or nullOptional<=200 characters
tool_choiceanyOptional
toolsanyOptional
tool_callsanyOptional
has_tool_callsbooleanOptional
categorystringOptional<=60 characters
time_to_first_tokendouble or nullOptional
routing_timedoubleOptional
keywordsai_paramsanyOptional
notestringOptional
session_idstringOptional<=254 characters
metadataanyOptional
metadata_indexed_string_1string or nullOptional
metadata_indexed_string_2string or nullOptional
metadata_indexed_numerical_1double or nullOptional
cachedbooleanOptional
cache_bitintegerOptional-2147483648-2147483647
cache_miss_bitinteger or nullOptional-32768-32767
cache_keystring or nullOptional<=254 characters
positive_feedbackboolean or nullOptional
tokens_per_seconddoubleOptional
full_requestanyOptional
full_responseanyOptional
statusenumOptional
status_codeintegerOptional-2147483648-2147483647
warningsstringOptional
recommendationsstring or nullOptional
has_warningsbooleanOptional
error_messagestringOptional
is_examplebooleanOptional
is_maliciousbooleanOptional
log_methodenumOptional
  • inference - Inference
  • logging_api - Logging Api
  • batch - Batch
  • python_tracing - Python Tracing
  • ts_tracing - Ts Tracing
  • tracing_integration - Tracing Integration
log_typeenumOptional
  • 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
failedbooleanOptional
error_bitintegerOptional-2147483648-2147483647
is_testbooleanOptional
environmentenumOptional
streambooleanOptional
stream_optionsanyOptional
temperaturedouble or nullOptional
max_tokensinteger or nullOptional-2147483648-2147483647
logit_biasanyOptional
logprobsboolean or nullOptional
top_logprobsinteger or nullOptional-2147483648-2147483647
frequency_penaltydouble or nullOptional
presence_penaltydouble or nullOptional
stopstring or nullOptional
ninteger or nullOptional-2147483648-2147483647
evaluation_identifierstring or nullOptional<=120 characters
is_datasetbooleanOptional
based_log_unique_idstring or nullOptional<=100 characters
customer_identifierstringOptional<=254 characters
customer_emailstringOptionalformat: "email"<=254 characters
customer_namestringOptional<=254 characters
customer_user_unique_idstring or nullOptional<=255 characters
used_custom_credentialbooleanOptional
deployment_namestringOptional<=254 characters
custom_endpointstring or nullOptional<=254 characters
custom_regionstring or nullOptional<=254 characters
prompt_namestring or nullOptional<=255 characters
prompt_idstringOptional<=100 characters
prompt_version_numberinteger or nullOptional-2147483648-2147483647
covered_byenumOptional
  • 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 or nullOptional
prompt_textstring or nullOptional
completion_textstring or nullOptional
system_text_vectorstring or nullOptional
prompt_text_vectorstring or nullOptional
completion_text_vectorstring or nullOptional
full_text_indexedbooleanOptional
trace_unique_idstring or nullOptional<=255 characters
span_unique_idstring or nullOptional<=255 characters
trace_group_identifierstring or nullOptional<=255 characters
span_namestring or nullOptional<=100 characters
span_handoffslist of strings or nullOptional
span_toolslist of strings or nullOptional
span_parent_idstring or nullOptional<=100 characters
span_pathstring or nullOptional
span_workflow_namestring or nullOptional<=255 characters
outputstring or nullOptional
thread_identifierstringOptional<=120 characters
thread_unique_idstring or nullOptional<=255 characters
storage_object_keystring or nullOptional
evaluation_costdoubleOptional
LLM_based_context_precisiondouble or nullOptional
LLM_based_faithfulnessdouble or nullOptional
flesch_reading_easedouble or nullOptional
flesch_kincaid_grade_leveldouble or nullOptional
LLM_based_answer_relevancedouble or nullOptional
amount_to_paydouble or nullOptional
full_cost_calculatedboolean or nullOptional
stripe_usage_report_sentboolean or nullOptional
to_update_threadboolean or nullOptional
to_update_customer_userboolean or nullOptional
organizationinteger or nullOptional
company_organizationinteger or nullOptional
userinteger or nullOptional
organization_keystring or nullOptional>=1 character
customer_userinteger or nullOptional
prompt_versioninteger or nullOptional
threadinteger or nullOptional
traceinteger or nullOptional
spaninteger or nullOptional

Response

idintegerRead-only
ip_addressstring or null<=100 characters
pre_commit_idstring or null<=120 characters
custom_identifierstring or null<=120 characters
group_identifierstring or null<=120 characters
blurredboolean or null
hour_groupdatetime
minute_groupdatetime
start_timedatetime or null
timestampdatetime
load_balance_group_idstring<=100 characters
unique_idstring or null<=100 characters
mapped_model_namestring<=255 characters
response_formatany
response_format_choicestring or null<=100 characters
parallel_tool_callsboolean or null
prompt_tokensinteger-2147483648-2147483647
completion_tokensinteger-2147483648-2147483647
prompt_cache_hit_tokensinteger or null-2147483648-2147483647
prompt_cache_creation_tokensinteger or null-2147483648-2147483647
total_request_tokensinteger-2147483648-2147483647
costdouble
inputstring
input_arraylist of strings or null
encoding_formatstring<=100 characters
dimensionsinteger or null-2147483648-2147483647
embeddinglist of doubles or null
base64_embeddingstring or null
audio_input_filestring or nullformat: "uri"
transcriptionstring
audio_response_formatstring<=100 characters
audio_output_filestring or nullformat: "uri"
prompt_messageslist of any
completion_messageany
completion_messageslist of any or null
latencydouble or null
modelstring<=100 characters
calling_modelstring or null<=100 characters
foundation_modelstring<=100 characters
provider_idstring<=100 characters
full_model_namestring or null<=200 characters
tool_choiceany
toolsany
tool_callsany
has_tool_callsboolean
categorystring<=60 characters
time_to_first_tokendouble or null
routing_timedouble
keywordsai_paramsany
notestring
session_idstring<=254 characters
metadataany
metadata_indexed_string_1string or null
metadata_indexed_string_2string or null
metadata_indexed_numerical_1double or null
cachedboolean
cache_bitinteger-2147483648-2147483647
cache_miss_bitinteger or null-32768-32767
cache_keystring or null<=254 characters
positive_feedbackboolean or null
tokens_per_seconddouble
full_requestany
full_responseany
statusenum
status_codeinteger-2147483648-2147483647
warningsstring
recommendationsstring or null
has_warningsboolean
error_messagestring
is_exampleboolean
is_maliciousboolean
log_methodenum
  • inference - Inference
  • logging_api - Logging Api
  • batch - Batch
  • python_tracing - Python Tracing
  • ts_tracing - Ts Tracing
  • tracing_integration - Tracing Integration
log_typeenum
  • 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-2147483648-2147483647
is_testboolean
environmentenum
streamboolean
stream_optionsany
temperaturedouble or null
max_tokensinteger or null-2147483648-2147483647
logit_biasany
logprobsboolean or null
top_logprobsinteger or null-2147483648-2147483647
frequency_penaltydouble or null
presence_penaltydouble or null
stopstring or null
ninteger or null-2147483648-2147483647
evaluation_identifierstring or null<=120 characters
is_datasetboolean
based_log_unique_idstring or null<=100 characters
customer_identifierstring<=254 characters
customer_emailstringformat: "email"<=254 characters
customer_namestring<=254 characters
customer_user_unique_idstring or null<=255 characters
used_custom_credentialboolean
deployment_namestring<=254 characters
custom_endpointstring or null<=254 characters
custom_regionstring or null<=254 characters
prompt_namestring or null<=255 characters
prompt_idstring<=100 characters
prompt_version_numberinteger or null-2147483648-2147483647
covered_byenum
  • 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 or null
prompt_textstring or null
completion_textstring or null
system_text_vectorstring or null
prompt_text_vectorstring or null
completion_text_vectorstring or null
full_text_indexedboolean
trace_unique_idstring or null<=255 characters
span_unique_idstring or null<=255 characters
trace_group_identifierstring or null<=255 characters
span_namestring or null<=100 characters
span_handoffslist of strings or null
span_toolslist of strings or null
span_parent_idstring or null<=100 characters
span_pathstring or null
span_workflow_namestring or null<=255 characters
outputstring or null
thread_identifierstring<=120 characters
thread_unique_idstring or null<=255 characters
storage_object_keystring or null
evaluation_costdouble
LLM_based_context_precisiondouble or null
LLM_based_faithfulnessdouble or null
flesch_reading_easedouble or null
flesch_kincaid_grade_leveldouble or null
LLM_based_answer_relevancedouble or null
amount_to_paydouble or null
full_cost_calculatedboolean or null
stripe_usage_report_sentboolean or null
to_update_threadboolean or null
to_update_customer_userboolean or null
organizationinteger or null
company_organizationinteger or null
userinteger or null
organization_keystring or null
customer_userinteger or null
prompt_versioninteger or null
threadinteger or null
traceinteger or null
spaninteger or null