Native language SDKcosantoir4 related surfaces

Python + FastAPI belongs to the same runtime contract, but it should still feel native to its own request boundary.

Direct evaluator client with `waf_evaluate`, `bot_evaluate`, and `ip_lookup`. Choose the native client when the service already lives outside the JavaScript wrapper family. The page should help you choose this surface deliberately, compare it against its lane neighbors, and keep operator proof in reach while you wire the integration.

lane family

4

Native language SDK

package line

1

cosantoir

contract vars

3

Shared across wrappers and native SDKs

operator lanes

2

Plus 2 native package families

cosantoirgithub.com/cosantoir/cosantoir-go@cosantoir/node@cosantoir/cli@cosantoir/mcpCOSANTOIR_GATEWAY_URLCOSANTOIR_API_KEYCOSANTOIR_SITE_IDpip install cosantoircosantoir logincosantoir-mcpcosantoirgithub.com/cosantoir/cosantoir-go@cosantoir/node@cosantoir/cli@cosantoir/mcpCOSANTOIR_GATEWAY_URLCOSANTOIR_API_KEYCOSANTOIR_SITE_IDpip install cosantoircosantoir logincosantoir-mcp

Surface fit

Choose this surface when the boundary is real, not convenient.

A better docs system tells you why this lane exists, what makes it distinct, and how it hands off to the rest of the platform.

Use this when

Choose the native client when the service already lives outside the JavaScript wrapper family.

Package line

cosantoir

The install and contract line should stay recognizable even when the request lifecycle changes.

First proof

Protect one real route, loader, or handler first, then read the resulting headers and decision state before broadening the rollout.

Install line

Python + FastAPI package install

bash
01pip install cosantoir
Install the surface that actually owns the request path. Do not start with a prettier abstraction and retrofit the boundary later.

Shared contract

Runtime identity

env
01COSANTOIR_GATEWAY_URL=http://localhost:4000
02COSANTOIR_API_KEY=dp_live_example
03COSANTOIR_SITE_ID=site_prod_web
These values should stay stable across framework wrappers, native SDKs, CLI probes, and MCP tools.

Contract discipline

The framework changes. The contract should not.

This is the point where the left rail, page body, and right rail need to agree: the package can change, but the gateway origin, runtime key, site id, and proof loop stay the same.

01

COSANTOIR_GATEWAY_URL

Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.

02

COSANTOIR_API_KEY

Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.

03

COSANTOIR_SITE_ID

Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.

Lane neighbors

Neighbor surfaces

A mature docs system makes adjacent choices visible. If this page is not the right boundary, the best alternative should already be in front of you.

Detailed guide

Python + FastAPI page guide

The framework-specific instructions live below, but they now sit inside a stronger system: lane fit above, contract line beside, neighbors nearby.

# FastAPI Integration FastAPI fits the Python client well because you can keep request inspection in a dependency or route function. ## Installation ``bash pip install cosantoir ` ## Example `python from fastapi import FastAPI, HTTPException, Request from cosantoir.client import Cosantoir, CosantoirOptions client = Cosantoir(CosantoirOptions( base_url="https://gateway.cosantoir.com", api_key="dp_live_example", site_id="site_prod_web", )) app = FastAPI() @app.post('/signup') async def signup(request: Request): decision = client.signup_evaluate(email='founder@example.com', ip=request.client.host) if decision.result and decision.result.get('action') == 'block': raise HTTPException(status_code=403, detail='Blocked by Cosantoir') return {'secure': True} ``

Last updated Mar 24, 2026