Documentation Index
Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
Filtering
Filters allow you to narrow down your query results. The API supports different filter operators depending on the field type.
Filter Structure
Field Filters
Metadata Filters
For standard fields, use fieldName:{
"fieldName": "modelName",
"operator": "IN",
"value": ["gpt-4", "gpt-3.5-turbo"]
}
For metadata fields, use metadataKey:{
"metadataKey": "environment",
"operator": "IN",
"value": ["production"]
}
Filterable Fields
| Field | Type | Description |
|---|
modelName | string | The name of the LLM model |
requestType | string | Type of request (e.g., “chat”, “completion”) |
userEmail | string | The email of the user making requests |
virtualAccount | string | The virtual account name |
team | array | Teams associated with the request |
latencyMs | number | Request latency in milliseconds |
conversationID | string | The conversation identifier |
virtualModelName | string | The virtual model name |
inputTokens | number | Number of input tokens |
outputTokens | number | Number of output tokens |
Filter Operators
String Field Operators
| Operator | Description | Example Value |
|---|
EQUAL | Exact match | "gpt-4" |
IN | Match any value in the list | ["gpt-4", "gpt-3.5-turbo"] |
NOT_IN | Exclude values in the list | ["deprecated-model"] |
STRING_CONTAINS | Contains substring | "gpt" |
STRING_STARTS_WITH | Starts with prefix | "gpt-" |
STRING_ENDS_WITH | Ends with suffix | "-turbo" |
GREATER_THAN | Lexicographically greater than | "gpt-3" |
LESS_THAN | Lexicographically less than | "gpt-5" |
GREATER_THAN_EQUAL | Lexicographically greater than or equal | "gpt-3" |
LESS_THAN_EQUAL | Lexicographically less than or equal | "gpt-5" |
BETWEEN | Lexicographically between two values | ["a", "z"] |
# Filter for specific models
{
"fieldName": "modelName",
"operator": "IN",
"value": ["gpt-4", "gpt-3.5-turbo"]
}
# Exclude specific users
{
"fieldName": "userEmail",
"operator": "NOT_IN",
"value": ["excluded@example.com"]
}
# Filter models containing "gpt"
{
"fieldName": "modelName",
"operator": "STRING_CONTAINS",
"value": "gpt"
}
# Filter models starting with "claude"
{
"fieldName": "modelName",
"operator": "STRING_STARTS_WITH",
"value": "claude"
}
Numeric Field Operators
| Operator | Description | Example Value |
|---|
EQUAL | Exact match | 1000 |
GREATER_THAN | Greater than value | 1000 |
LESS_THAN | Less than value | 5000 |
GREATER_THAN_EQUAL | Greater than or equal to | 100 |
LESS_THAN_EQUAL | Less than or equal to | 1000 |
BETWEEN | Between two values (inclusive) | [500, 5000] |
IN | Match any value in the list | [100, 200, 300] |
NOT_IN | Exclude values in the list | [0] |
# Filter for high latency requests
{
"fieldName": "latencyMs",
"operator": "GREATER_THAN",
"value": 1000
}
# Filter for latency within a range
{
"fieldName": "latencyMs",
"operator": "BETWEEN",
"value": [500, 5000]
}
# Filter for requests with significant input tokens
{
"fieldName": "inputTokens",
"operator": "GREATER_THAN",
"value": 100
}
Array Field Operators (Teams)
| Operator | Description | Example Value |
|---|
ARRAY_HAS_ANY | Match if array contains any of the values | ["team-alpha", "team-beta"] |
ARRAY_HAS_NONE | Match if array contains none of the values | ["excluded-team"] |
# Filter for specific teams
{
"fieldName": "team",
"operator": "ARRAY_HAS_ANY",
"value": ["team-alpha", "team-beta"]
}
# Exclude specific teams
{
"fieldName": "team",
"operator": "ARRAY_HAS_NONE",
"value": ["excluded-team"]
}
Combining Multiple Filters
You can combine multiple filters in a single query. All filters are applied with AND logic:
{
"startTs": "2025-01-21T00:00:00.000Z",
"endTs": "2025-01-22T00:00:00.000Z",
"datasource": "modelMetrics",
"type": "distribution",
"aggregations": [],
"filters": [
{
"fieldName": "virtualModelName",
"operator": "IS_NULL",
"value": true
},
{
"fieldName": "modelName",
"operator": "IN",
"value": ["gpt-4", "gpt-3.5-turbo"]
},
{
"fieldName": "latencyMs",
"operator": "LESS_THAN",
"value": 5000
},
{
"fieldName": "team",
"operator": "ARRAY_HAS_ANY",
"value": ["team-alpha"]
},
{
"metadataKey": "environment",
"operator": "IN",
"value": ["production"]
}
],
"groupBy": ["modelName", "team"]
}