Gateway
Reference for client.gateway in the Future AGI Python and TypeScript SDKs: gateway.analytics, gateway.config, gateway.list, gateway.guardrail_rules.list, gateway.request_logs.list, gateway.sessions.list and 1 more.
client.gateway on fi.Client (Python) and client.gateway on Client from @future-agi/sdk (TypeScript), with the nested resources client.gateway.guardrail_rules, client.gateway.request_logs, client.gateway.sessions. The models these methods return are on Gateway response models; how arguments, pagination, errors and strict mode work is in the overview.
Methods
| Method | Description |
|---|---|
gateway.analytics | Return overview usage, latency, error, and cost analytics for the AI gateway. |
gateway.config | Return the effective configuration for an AI gateway. |
gateway.list | List configured AI gateways. |
gateway.guardrail_rules.list | Per-rule guardrail trigger breakdown - which guardrail rules exist and how often each has fired. |
gateway.request_logs.list | List request logs recorded by the AI gateway. |
gateway.sessions.list | List AI gateway sessions with their stats. |
gateway.sessions.requests | List every request log belonging to one gateway session. |
client.gateway
gateway.analytics
Return overview usage, latency, error, and cost analytics for the AI gateway.
/agentcc/analytics/overview/ MCP tool: get_gateway_analytics
result = client.gateway.analytics()const result = await client.gateway.analytics(); Signature
client.gateway.analytics(
*,
start: str | None | NotGiven = NOT_GIVEN,
end: str | None | NotGiven = NOT_GIVEN,
granularity: str | None | NotGiven = NOT_GIVEN,
api_key_id: str | None | NotGiven = NOT_GIVEN,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> Anyclient.gateway.analytics(params: GatewayAnalyticsParams = {}, options?: RequestOptions): Promise<unknown>
export interface GatewayAnalyticsParams {
start?: string | null;
end?: string | null;
granularity?: string | null;
/** Gateway key id (not the API key's UUID primary key). */
api_key_id?: string | null;
} Parameters
Gateway key id (not the API key’s UUID primary key).
Returns
The decoded response. The contract does not describe its shape, so it is untyped.
gateway.config
Return the effective configuration for an AI gateway.
/agentcc/gateways/{id}/config/ MCP tool: get_gateway_config
result = client.gateway.config("your-id")const result = await client.gateway.config("your-id"); Signature
client.gateway.config(
id: str,
*,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> models.GatewayConfigResultclient.gateway.config(id: string, options?: RequestOptions): Promise<models.GatewayConfigResult> Parameters
Positional argument id.
Returns
gateway.list
List configured AI gateways.
/agentcc/gateways/ MCP tool: list_gateways
result = client.gateway.list()const result = await client.gateway.list(); Signature
client.gateway.list(
*,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> List[models.GatewaySummaryResult]client.gateway.list(options?: RequestOptions): Promise<Array<models.GatewaySummaryResult>> Parameters
This method takes no parameters beyond the per-call options.
Returns
A list of GatewaySummaryResult.
client.gateway.guardrail_rules
TypeScript: client.gateway.guardrailRules.
gateway.guardrail_rules.list
Per-rule guardrail trigger breakdown - which guardrail rules exist and how often each has fired. Request logs report guardrail_triggered but not which rule caused it; this is what turns “the request was blocked” into “the PII rule blocked it”.
/agentcc/analytics/guardrail-rules/ MCP tool: list_guardrail_rules
result = client.gateway.guardrail_rules.list()const result = await client.gateway.guardrailRules.list(); Signature
client.gateway.guardrail_rules.list(
*,
page: int | None | NotGiven = NOT_GIVEN,
limit: int | None | NotGiven = NOT_GIVEN,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> Anyclient.gateway.guardrailRules.list(params: GatewayGuardrailRulesListParams = {}, options?: RequestOptions): Promise<unknown>
export interface GatewayGuardrailRulesListParams {
/** A page number within the paginated result set. */
page?: number | null;
/** Number of results to return per page. */
limit?: number | null;
} Parameters
A page number within the paginated result set.
Number of results to return per page.
Returns
The decoded response. The contract does not describe its shape, so it is untyped.
client.gateway.request_logs
TypeScript: client.gateway.requestLogs.
gateway.request_logs.list
List request logs recorded by the AI gateway.
/agentcc/request-logs/ Paginated: returns a pager (how pagination works) · MCP tool: list_gateway_request_logs
for item in client.gateway.request_logs.list():
print(item)for await (const item of client.gateway.requestLogs.list()) {
console.log(item);
} Signature
client.gateway.request_logs.list(
*,
limit: int | None | NotGiven = NOT_GIVEN,
user_id: str | None | NotGiven = NOT_GIVEN,
session_id: str | None | NotGiven = NOT_GIVEN,
api_key_id: str | None | NotGiven = NOT_GIVEN,
request_id: str | None | NotGiven = NOT_GIVEN,
model: str | None | NotGiven = NOT_GIVEN,
provider: str | None | NotGiven = NOT_GIVEN,
status_code: str | None | NotGiven = NOT_GIVEN,
min_status_code: int | None | NotGiven = NOT_GIVEN,
max_status_code: int | None | NotGiven = NOT_GIVEN,
is_error: bool | None | NotGiven = NOT_GIVEN,
cache_hit: bool | None | NotGiven = NOT_GIVEN,
fallback_used: bool | None | NotGiven = NOT_GIVEN,
guardrail_triggered: bool | None | NotGiven = NOT_GIVEN,
is_stream: bool | None | NotGiven = NOT_GIVEN,
started_after: str | None | NotGiven = NOT_GIVEN,
started_before: str | None | NotGiven = NOT_GIVEN,
min_latency: int | None | NotGiven = NOT_GIVEN,
max_latency: int | None | NotGiven = NOT_GIVEN,
min_cost: float | None | NotGiven = NOT_GIVEN,
max_cost: float | None | NotGiven = NOT_GIVEN,
min_tokens: int | None | NotGiven = NOT_GIVEN,
max_tokens: int | None | NotGiven = NOT_GIVEN,
q: str | None | NotGiven = NOT_GIVEN,
search: str | None | NotGiven = NOT_GIVEN,
ordering: str | None | NotGiven = NOT_GIVEN,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> SyncPager[models.AgentccRequestLog]client.gateway.requestLogs.list(params: GatewayRequestLogsListParams = {}, options?: RequestOptions): Pager<models.AgentccRequestLog>
export interface GatewayRequestLogsListParams {
limit?: number | null;
user_id?: string | null;
session_id?: string | null;
/** Gateway key id (not the API key's UUID primary key). */
api_key_id?: string | null;
request_id?: string | null;
/** Comma-separated model names. */
model?: string | null;
/** Comma-separated provider names. */
provider?: string | null;
/** Comma-separated HTTP status codes. */
status_code?: string | null;
min_status_code?: number | null;
max_status_code?: number | null;
is_error?: boolean | null;
cache_hit?: boolean | null;
fallback_used?: boolean | null;
guardrail_triggered?: boolean | null;
is_stream?: boolean | null;
started_after?: string | null;
started_before?: string | null;
min_latency?: number | null;
max_latency?: number | null;
min_cost?: number | null;
max_cost?: number | null;
min_tokens?: number | null;
max_tokens?: number | null;
q?: string | null;
search?: string | null;
ordering?: string | null;
} Parameters
Gateway key id (not the API key’s UUID primary key).
Comma-separated model names.
Comma-separated provider names.
Comma-separated HTTP status codes.
The pager sends page itself; pass limit to change the page size.
Returns
A pager of AgentccRequestLog items: iterate it, or call to_list() (Python) / toArray() (TypeScript).
client.gateway.sessions
TypeScript: client.gateway.sessions.
gateway.sessions.list
List AI gateway sessions with their stats. These are gateway sessions, distinct from the tracing sessions returned by list_sessions. Use this to obtain a session id for list_gateway_session_requests.
/agentcc/sessions/ Paginated: returns a pager (how pagination works) · MCP tool: list_gateway_sessions
for item in client.gateway.sessions.list():
print(item)for await (const item of client.gateway.sessions.list()) {
console.log(item);
} Signature
client.gateway.sessions.list(
*,
limit: int | None | NotGiven = NOT_GIVEN,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> SyncPager[models.AgentccSession]client.gateway.sessions.list(params: GatewaySessionsListParams = {}, options?: RequestOptions): Pager<models.AgentccSession>
export interface GatewaySessionsListParams {
/** Number of results to return per page. */
limit?: number | null;
} Parameters
Number of results to return per page.
The pager sends page itself; pass limit to change the page size.
Returns
A pager of AgentccSession items: iterate it, or call to_list() (Python) / toArray() (TypeScript).
gateway.sessions.requests
List every request log belonging to one gateway session. Request logs carry no trace id, so grouping by session is the way to see what else happened around a failed request.
/agentcc/sessions/{id}/requests/ MCP tool: list_gateway_session_requests
result = client.gateway.sessions.requests("your-id")const result = await client.gateway.sessions.requests("your-id"); Signature
client.gateway.sessions.requests(
id: str,
*,
extra_query: dict[str, Any] | None = None,
options: RequestOptions | None = None,
) -> Anyclient.gateway.sessions.requests(id: string, options?: RequestOptions): Promise<unknown> Parameters
A UUID string identifying this agentcc session.
Returns
The decoded response. The contract does not describe its shape, so it is untyped.
Questions & Discussion