Request Logs
Request Logs
toothfairyai@latest…Manager for request logs operations.
This manager provides methods to create, update, and manage request logs.
Example:
>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> request_log = client.request_logs.get(...)
Accessed via client.requestLogs.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
get | GET | GET /request/get/{request_log_id} |
list | GET | GET /request/list |
get_by_type | — | derived |
get_by_status | — | derived |
get
Get a request_log by ID.
def get(request_log_id: str) -> RequestLog
Endpoint: GET /request/get/{request_log_id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the request log |
srtKey | string | Sort key for the request |
type | string | Type classification (free-form string identifier) |
Allowed: translator, answerer, parser, tokenizer, embedder, detector, questioner, generator, chatter, planner, analyser |
| status | string | Current status of the resource
Allowed: success, failed, timeout, fulfilled, pending, inProgress, cancelled, awaitingUserInput, continued, ingested |
| words | integer | Number of words processed |
| tokens | integer | Number of tokens processed |
| sentences | integer | Number of sentences processed |
| artifactsNumber | integer | Number of artifacts generated |
| modelType | string | Model used for the request
Allowed: extraSmall, small, medium, large, extraLarge, local, custom, external |
| outputType | string | Type of output generated: images, videos, modelling, text, code_interpreter, canvas, internet_search, deep_thinking, browser, audio, voice, or rag
Allowed: images, videos, modelling, text, code_interpreter, canvas, internet_search, deep_thinking, browser, audio, voice, rag |
| inputTokens | integer | Number of input tokens consumed |
| outputTokens | integer | Number of output tokens generated |
| totalTokens | integer | Total tokens (input + output) |
| inputCostUSD | number | Cost of input tokens in USD |
| outputCostUSD | number | Cost of output tokens in USD |
| totalCostUSD | number | Total cost in USD |
| callType | string | Type of API call |
| callPurpose | string | Purpose of the API call |
| latencyMs | integer | Request latency in milliseconds |
| agentID | string | ID of the agent associated with this resource |
| workspaceID | string | Unique workspace identifier (UUID v4) |
| createdBy | string | User ID who created the request |
| updatedBy | string | User ID who last updated the request |
| creationTime | integer | Unix timestamp when the resource was created |
| isFromToothFairy | boolean | Whether the request originated from ToothFairyAI's own services |
| chatID | string | ID of the chat this message belongs to |
| messageID | string | ID of the associated chat message |
| createdAt | string | Timestamp when this resource was created |
| updatedAt | string | Timestamp when this resource was last updated |
Example
client.requestLogs.get(request_log_id="agent-id")
list
List all request logs.
def list(
limit: Optional[int] = None,
offset: Optional[int] = None
) -> ListResponse
Endpoint: GET /request/list · API service
Example
client.requestLogs.list()
get_by_type
Get request logs by type.
def get_by_type(log_type: str) -> List[RequestLog]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.requestLogs.get_by_type(log_type="…")
get_by_status
Get request logs by status.
def get_by_status(status: str) -> List[RequestLog]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.requestLogs.get_by_status(status="…")