NOUKAI

Python Installation

Install and configure the Noukai Python SDK.

Install the package

Install from PyPI:

pip install noukai-sdk

Or with uv (faster):

uv pip install noukai-sdk

Requirements: Python 3.11+

Get an API key

Visit Noukai Console to create an API key starting with nk_.

Configure authentication and defaults

Set the API key as an environment variable:

export NOUKAI_API_KEY=nk_yourkey_...

Optionally set your default org and project to simplify flow references:

export NOUKAI_ORG=acme
export NOUKAI_PROJECT=spelling

Or pass them directly to the client:

from noukai_sdk import Noukai
 
client = Noukai(api_key="nk_yourkey_...", org="acme", project="spelling")

Verify installation

Run a quick test:

from noukai_sdk import Noukai
 
with Noukai(org="acme", project="spelling") as client:
    flow = client.flow("grade-3")
    result = flow.execute(message="The cat sat on the mat.")
    print(result.output)

If you see output, you're ready to go! (Or use the fully-qualified form client.flow("acme/spelling/grade-3") if you prefer.)

Advanced configuration

Local development

For local development, use env="dev" to connect to http://localhost:8080/api/v1:

from noukai_sdk import Noukai
 
client = Noukai(
    api_key="nk_...",
    env="dev",
    org="acme",
    project="spelling"
)

Or set the environment variable:

export NOUKAI_ENV=dev

The env parameter accepts:

  • "dev" or "development"http://localhost:8080/api/v1
  • "production" (default) → https://api.noukai.xyz/api/v1
  • Other values use the production default

URL targeting

The SDK targets Noukai's hosted endpoints (api.noukai.xyz for production, localhost:8080 for env="dev"). There is no way to point the SDK at a custom URL — this is a deliberate constraint to prevent accidental misrouting.

The only user-facing way to switch URL targets is the env option (or NOUKAI_ENV env var).

Timeouts and retries

Customize request timeouts and retry behavior:

from noukai_sdk import Noukai
 
client = Noukai(
    timeout=300_000,    # 5 minutes (default: 300 seconds)
    max_retries=1       # Retry once on 5xx (default: 1)
)

Logging

Enable debug logging:

import logging
 
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("noukai_sdk")
logger.setLevel(logging.DEBUG)

Next steps

Using FastAPI or async contexts? Use AsyncNoukai instead. See Async vs Sync.

On this page