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

MethodDescription
gateway.analyticsReturn overview usage, latency, error, and cost analytics for the AI gateway.
gateway.configReturn the effective configuration for an AI gateway.
gateway.listList configured AI gateways.
gateway.guardrail_rules.listPer-rule guardrail trigger breakdown - which guardrail rules exist and how often each has fired.
gateway.request_logs.listList request logs recorded by the AI gateway.
gateway.sessions.listList AI gateway sessions with their stats.
gateway.sessions.requestsList every request log belonging to one gateway session.

client.gateway

gateway.analytics

Return overview usage, latency, error, and cost analytics for the AI gateway.

GET /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,
) -> Any
client.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

start string Optional
end string Optional
granularity string Optional
api_key_id string Optional

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.

GET /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.GatewayConfigResult
client.gateway.config(id: string, options?: RequestOptions): Promise<models.GatewayConfigResult>

Parameters

id string Required

Positional argument id.

Returns

GatewayConfigResult.

gateway.list

List configured AI gateways.

GET /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”.

GET /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,
) -> Any
client.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

page integer Optional

A page number within the paginated result set.

limit integer Optional

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.

GET /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

limit integer Optional
user_id string Optional
session_id string Optional
api_key_id string Optional

Gateway key id (not the API key’s UUID primary key).

request_id string Optional
model string Optional

Comma-separated model names.

provider string Optional

Comma-separated provider names.

status_code string Optional

Comma-separated HTTP status codes.

min_status_code integer Optional
max_status_code integer Optional
is_error boolean Optional
cache_hit boolean Optional
fallback_used boolean Optional
guardrail_triggered boolean Optional
is_stream boolean Optional
started_after string Optional
started_before string Optional
min_latency integer Optional
max_latency integer Optional
min_cost number Optional
max_cost number Optional
min_tokens integer Optional
max_tokens integer Optional
q string Optional
search string Optional
ordering string Optional

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.

GET /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

limit integer Optional

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.

GET /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,
) -> Any
client.gateway.sessions.requests(id: string, options?: RequestOptions): Promise<unknown>

Parameters

id string Required

A UUID string identifying this agentcc session.

Returns

The decoded response. The contract does not describe its shape, so it is untyped.

Was this page helpful?

Questions & Discussion