Skip to content

Configuration Reference

Kirak enforces strict separation between secrets and non-secret configuration settings.

  • Secrets (database passwords, API keys, JWT secret keys, webhook signing secrets) are strictly read from environment variables (or .env files). They are never written to source-controlled configuration files.
  • Non-secret settings (API titles, CORS rules, module enabling, database hosts, pool sizes, rate limits) are strictly read from kirak.json (and optional kirak.local.json overrides). There is no silent fallback from environment variables for non-secret settings.

Configuration Precedence & Merging Pipeline

Section titled “Configuration Precedence & Merging Pipeline”

The following diagram illustrates how Kirak discovers, merges, validates, and applies configuration at startup:

flowchart TD
subgraph Sources["Configuration Sources"]
KJ["kirak.json (Committed Manifest)"]
KLJ["kirak.local.json (Local Override)"]
ENV[".env / Shell Environment (Secrets Only)"]
DEF["Kirak Runtime Defaults"]
end
subgraph MergeStage["1. Manifest Merge Engine"]
MERGE{"Merge Engine"}
KJ --> MERGE
KLJ -.->|Key-by-Key Object Merge\nAtomic List/Scalar Replacement| MERGE
MERGE --> COMBINED["Combined JSON Manifest"]
end
subgraph ValidationStage["2. Validation & Sanity Guard"]
SCHEMA["JSON Schema Check (.kirak/manifest.schema.json)"]
SECRET_GUARD["Secret Leak Guard (Reject passwords/keys in JSON)"]
COMBINED --> SCHEMA
SCHEMA --> SECRET_GUARD
end
subgraph FactoryStage["3. Application Initialization"]
FACTORY["create_kirak_app(models_path=...)"]
APP_INIT["Kirak.prepare() & Kirak.connect()"]
SECRET_GUARD --> FACTORY
ENV --> APP_INIT
DEF --> APP_INIT
FACTORY --> APP_INIT
end
subgraph RuntimeState["4. Active Runtime State"]
CONFIG["kirak.manifest & Module Configs"]
APP_INIT --> CONFIG
end
  1. kirak.local.json: Merged on top of kirak.json at startup. Allows local developer overrides (e.g. localhost vs container network names) without polluting Git history.
  2. kirak.json: Primary project manifest committed to version control.
  3. Runtime Defaults: Built-in framework defaults defined in KirakManifest dataclasses.
  4. Environment Variables: Provide secrets to provider instances and core authentication. Environment variables never override non-secret settings declared in kirak.json.

Object vs. Scalar Merge Rules (kirak.local.json)

Section titled “Object vs. Scalar Merge Rules (kirak.local.json)”

When kirak.local.json exists beside kirak.json:

  • Nested Objects (database, cors, rate_limit, auth, branding): Merged key-by-key at any arbitrary nesting depth. Keys not present in kirak.local.json retain their values from kirak.json.
  • Arrays & Scalars (origins, modules, strings, numbers, booleans): Replaced atomically as a complete unit. For example, if cors.origins is specified in kirak.local.json, it completely replaces the list from kirak.json; it is not concatenated.

The application factory create_kirak_app initializes FastAPI and configures Kirak’s runtime pipeline.

from kirak import create_kirak_app
app = create_kirak_app(
models_path="./models/",
on_startup=custom_startup_task,
on_kirak_ready=register_custom_hooks,
on_shutdown=custom_cleanup_task,
)
Parameter Type Default Description
models_path str Required Absolute or relative path to a single models.json file or a directory containing individual *.json model definitions. A directory that is missing or empty means an app with no models of its own: it starts with only the built-in tables. A missing models.json file is an error.
middlewares Optional[List[Tuple[type, dict]]] None Custom ASGI middleware tuples formatted as (MiddlewareClass, options_dict). Added inside Kirak’s security envelope.
on_startup Optional[Callable] None async def callback(app) executed before Kirak database connection and router compilation. Ideal for third-party clients (e.g. Redis pools) that don’t depend on Kirak.
on_kirak_ready Optional[Callable] None async def callback(kirak) executed after database connection is established (await kirak.connect()) but before REST/GraphQL routers are mounted. Ideal for registering custom hooks or provider extensions.
on_shutdown Optional[Callable] None async def callback(app) executed after Kirak disconnects from the database and stops background workers.
**kwargs Any — Forwarded directly to the underlying fastapi.FastAPI(...) constructor.

[!CAUTION] Keyword Arguments vs. Manifest Settings: create_kirak_app() strictly disallows passing configuration settings via kwargs (title, version, description, cors_origins, modules, etc.). Attempting to pass these raises a TypeError specifying the exact kirak.json key where the configuration belongs.


Below is a fully populated kirak.json manifest illustrating all supported configuration blocks.

{
"$schema": ".kirak/manifest.schema.json",
"kirak_version": "1.0.0",
"version": "1.0.0",
"title": "Production API",
"description": "High-performance enterprise REST API powered by Kirak",
"project_name": "Acme Commerce",
"base_url": "https://api.acme.com",
"log_level": "INFO",
"log_path": "logs",
"log_output": "both",
"log_format": "json",
"max_body_mb": 10,
"strict_access": true,
"hsts": true,
"hook_timeout_seconds": 5.0,
"bulk_chunk_size": 500,
"modules": [
"notifications",
"storage",
"scheduler",
"payments",
"integrations",
"ai",
"vector",
"mcp",
"monitoring"
],
"database": {
"type": "postgres",
"host": "postgres.internal",
"port": 5432,
"name": "acme_db",
"user": "acme_app",
"pool_min": 5,
"pool_max": 20,
"pool_recycle_seconds": 3600
},
"cors": {
"enabled": true,
"allow_credentials": true,
"allow_methods": ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
"allow_headers": ["Authorization", "Content-Type", "X-Request-ID"],
"origins": [
"https://app.acme.com",
"https://admin.acme.com"
]
},
"routes": {
"crud_prefix": "/api/v1",
"auth_prefix": "/auth",
"module_prefixes": {
"payments": "/billing",
"notifications": "/alerts"
}
},
"docs": {
"enabled": true,
"path": "/docs",
"public": false
},
"openapi": {
"enabled": true,
"public": true
},
"rate_limit": {
"enabled": true,
"default_max_requests": 100,
"default_window_seconds": 60,
"trusted_proxy_ips": [
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
]
},
"auth": {
"jwt_algorithm": "HS256",
"access_token_expire_minutes": 15,
"refresh_token_expire_days": 14,
"refresh_token_reuse_interval_seconds": 10,
"cookie_name": "acme_session",
"cookie_domain": ".acme.com",
"social_providers": ["google-oauth2", "github"],
"social": {
"google-oauth2": {
"client_id": "847291048123-xxx.apps.googleusercontent.com",
"redirect_uri": "https://api.acme.com/auth/google-oauth2/callback",
"scope": "openid email profile"
},
"github": {
"client_id": "Iv1.8391028301928374",
"redirect_uri": "https://api.acme.com/auth/github/callback",
"require_public_email": false
}
},
"redirect_urls": [
"https://app.acme.com/oauth/callback",
"acmeapp://oauth-callback"
],
"bcrypt_rounds": 12,
"password_complexity": true,
"account_close_window": "30d"
},
"branding": {
"logo": "https://cdn.acme.com/logo.png",
"support_email": "support@acme.com",
"website_url": "https://acme.com",
"login_url": "https://app.acme.com/login",
"primary_bg_color": "#0F172A",
"secondary_bg_color": "#2563EB",
"primary_text_color": "#0F172A",
"secondary_text_color": "#FFFFFF"
},
"notifications": {
"email_from_address": "no-reply@acme.com",
"email_from_name": "Acme Notifications",
"email": {
"default_provider": "ses_prod",
"providers": {
"ses_prod": {
"type": "aws_ses",
"aws_region": "us-east-1"
}
}
}
},
"storage": {
"default_provider": "s3_media",
"providers": {
"s3_media": {
"type": "aws_s3",
"bucket": "acme-media-prod",
"region": "us-east-1",
"visibility": "private"
}
},
"image_allowed_types": "jpg,jpeg,png,webp",
"image_max_size": "10mb",
"signed_url_ttl": 3600
},
"scheduler": {
"mode": "loops",
"default_provider": "db_queue",
"providers": {
"db_queue": {
"type": "database"
}
},
"poll_interval": 5,
"concurrency": 8,
"default_queue": "default",
"job_timeout": 1800,
"max_retries": 3,
"job_retention_days": 14
},
"payments": {
"default_provider": "stripe_us",
"providers": {
"stripe_us": {
"type": "stripe"
}
},
"success_url": "https://app.acme.com/billing/success",
"cancel_url": "https://app.acme.com/billing/cancel",
"require_auth": true
},
"monitoring": {
"sinks": ["sqlite", "stdout"],
"batch_interval_seconds": 5,
"retention_days": 14,
"sample_rate": 1.0,
"slow_request_threshold_ms": 400
},
"ai": {
"default_model": "anthropic:claude-3-5-sonnet-20241022",
"conversation_ttl_seconds": 3600,
"compaction_token_threshold": 100000,
"request_timeout_seconds": 60
},
"custom": {
"feature_flags": {
"new_onboarding_flow": true
}
}
}

1. Root Engine & Logging Settings
  • kirak_version (string, "X.Y.Z"): The Kirak version the project’s files are written for. kirak new sets it to the installed Kirak; kirak upgrade --apply moves it to the installed Kirak after running the upgrade steps of the releases in between. The app does not read it. See kirak upgrade.
  • version (string, default: "1.0.0"): API version string reported in OpenAPI schemas and /docs.
  • title (string, default: "Kirak API"): Public API name.
  • description (string): Description rendered in documentation endpoints.
  • project_name (string): Application name displayed as the issuer in authenticator apps (TOTP) and outgoing SMS OTP messages.
  • base_url (string): Canonical public base URL used to assemble password reset links, verification emails, OAuth callback URLs, and payment return URLs given as a path (payments.success_url, cancel_url).
  • log_level (string, default: "INFO"): Standard logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
  • log_output (string, default: "file"): Logging target: "file" (writes to kirak.log), "stdout", or "both".
  • log_format (string, default: "text"): Formatter style: "text" for standard human-readable terminal output or "json" for structured log collectors (e.g. CloudWatch, Google Cloud Logging).

log_level, log_output and log_format apply to Kirak’s modules and to the app’s own loggers alike: a logging.getLogger("shop.orders") line goes to the same place, in the same format, with the request and user id. Kirak sets this up on the root logger when it starts, unless the app has already given the root logger a handler of its own. The HTTP client loggers httpx and httpcore, which log every request at INFO, start at WARNING; set their level in the app (logging.getLogger("httpx").setLevel("INFO")) to see those lines.

  • max_body_mb (integer, default: 10): Maximum HTTP request body size in megabytes before Starlette raises 413 PAYLOAD_TOO_LARGE.
  • strict_access (boolean, default: false): When true, halts application startup if any model lacks an explicit access block.
  • hsts (boolean, default: false): When true, every response carries Strict-Transport-Security: max-age=31536000, so browsers refuse plain HTTP to the host for a year. Turn it on only when the app is served over HTTPS.
  • hook_timeout_seconds (float, default: 5.0): Maximum execution budget for synchronous lifecycle hooks before a HookTimeoutError is raised.
2. Database Configuration (`database`)

Kirak manages an internal asynchronous connection pool for PostgreSQL, MySQL, and SQLite.

Key Type Default Description
type string "mysql" Database engine: "mysql", "postgres" (or "postgresql"), or "sqlite".
host string "localhost" Database server hostname or IP address (ignored for SQLite).
port integer dialect default Port number (3306 for MySQL, 5432 for PostgreSQL).
name string "" Database name on the server, or the file path (e.g. "acme.db") for SQLite.
user string "root" Database username (ignored for SQLite). kirak new --database mysql writes the placeholder <name>_app instead: create that user with rights on the project database only.
pool_min integer 1 Minimum persistent pool connections maintained by Kirak (ignored for SQLite).
pool_max integer 10 Maximum pool connections allocated under load (ignored for SQLite).
pool_recycle_seconds integer 3600 Connection recycling interval to prevent dropped connections from network firewalls.

[!NOTE] Password Management: The database password is never written to kirak.json. Set DB_PASSWORD in your .env file.

3. CORS Configuration (`cors`)

Configured directly via FastAPI CORSMiddleware.

  • enabled (boolean, default: true): Enables or disables the CORS middleware.
  • origins (list[string], default: []): Explicit list of allowed origins (e.g. ["https://app.acme.com"]).
  • allow_origin_regex (string | null): Optional regular expression to match dynamic subdomains (e.g. "https://.*\\.acme\\.com").
  • allow_credentials (boolean, default: true): Allows cookies, authorization headers, and TLS client certificates.
  • allow_methods (list[string], default: ["*"]): Allowed HTTP request methods.
  • allow_headers (list[string], default: ["*"]): Allowed HTTP request headers.
4. Routes & URL Prefixes (`routes`)

Allows restructuring API routes to meet legacy or microservice URL contracts.

  • crud_prefix (string, default: ""): Prepended to all declarative model endpoints (e.g. "/api/v1" creates /api/v1/posts/fetch).
  • auth_prefix (string, default: null): Custom prefix for authentication routes (defaults to "/auth").
  • module_prefixes (dict[string, string]): Map of module name to custom mount path (e.g. {"payments": "/billing"}).
5. Authentication (`auth`)

Controls token lifetimes, cookie scopes, security policies, and social providers.

auth key Type Description
jwt_algorithm string Token signing algorithm. Asymmetric algorithms are rejected. Default HS256.
access_token_expire_hours integer Access token lifetime in hours, used when access_token_expire_minutes is not set. Default: 15 minutes.
access_token_expire_minutes integer Access token lifetime in minutes. When set, wins over access_token_expire_hours. Default 15.
refresh_token_expire_days integer Refresh token lifetime in days. Default 14.
refresh_token_reuse_interval_seconds integer Seconds a rotated refresh token may still be used, for retries and tabs refreshing at once. Used later, it revokes its whole session. 0 disables the window. Default 10.
cookie_name string When set, access tokens are also written to an HttpOnly cookie of this name on login, OTP verification, refresh and social callbacks.
refresh_cookie_name string When set, every route that issues a refresh token (login, MFA challenge, OTP verification, refresh, social sign-ins) puts it in an HttpOnly, Secure, SameSite=Strict cookie of this name, path the auth routes (routes.auth_prefix, default /auth), and leaves refreshToken out of the response body. /auth/refresh-token and /auth/logout read it from the cookie when the body has none; logout and closing the account delete it. The app’s pages and the API must be on the same site (app.example.com and api.example.com). Default empty (refreshToken in the body).
cookie_domain string Domain of the auth cookies (cookie_name, refresh_cookie_name). A leading dot (.example.com) shares them across subdomains.
social_providers array Social login providers to enable, by social-core name (e.g. google-oauth2, github, apple-id).
social object Non-secret settings per social provider. The block key is the social-core provider name (e.g. google-oauth2, apple-id, discord). All providers accept client_id, redirect_uri, scope and allow_no_email. Apple (apple-id) also accepts key_id, team_id. Google (google-oauth2) and OpenID Connect providers also accept audience and nonce for mobile native sign-in. Any other setting a backend reads can be set as its lowercase social-core name (e.g. auth0: {“domain”: …}). Secrets use the social-core convention: SOCIAL_AUTH_SECRET; other secret settings (client_assertion, sp_private_key, bot_token, api_key) are SOCIAL_AUTH_.
forgot_password_page_url string Frontend page with the password reset form, linked from reset emails. Default {base_url}/auth/forgot-password (/auth is routes.auth_prefix when set).
verify_email_page_url string Frontend page the verification email links to, with ?token=…; the page POSTs the token to {auth prefix}/verify-email. Default {base_url}/auth/verify-email, a built-in page with a button that does the same (/auth is routes.auth_prefix when set).
redirect_urls array Exact URLs a browser social sign-in may return to (redirect_to), with a one-time code the app exchanges at /auth/token/exchange: an app’s URL scheme (com.example.app://auth) or a web page. Matched exactly: no wildcards, no query. Default [] (sign-ins answer with JSON).
bcrypt_rounds integer bcrypt work factor for password hashes. Each step doubles the time a hash takes (12: about 0.25 s, 14: about 1 s). Values outside 10 to 14 are refused. Default 12.
password_complexity boolean Require an uppercase letter, a lowercase letter, a digit and a special character. The minimum length of 12 always applies. Default true.
registration string Who may create an account through Kirak’s sign-up routes: POST /auth/register, a first phone-code sign-in and a first social sign-in. closed refuses each with 403 REGISTRATION_CLOSED and creates nothing; existing users still sign in every way, and app code still creates users (kirak.auth.register(), kirak.create(“users”)), for invitations or approved sign-ups. Default open.
account_reopen boolean Whether a user who closed their own account may reopen it during account_close_window: a sign-in that passes every check (password or code, MFA) answers 403 ACCOUNT_CLOSED with details.reopen_token, and POST /auth/reopen-account with it reopens the account and signs in. An account an admin closed is never reopened this way. Default true.
account_close_window string Time between closing an account (POST /auth/close-account) and deleting its data. During the window the account cannot sign in and an admin can restore it; immediate deletes at once. Default 30d.

Social login secrets and per-provider blocks are in the Social Providers Reference.

6. Rate Limiting (`rate_limit`)

Global rate limiting parameters applied across all CRUD routes unless overridden at the model level.

  • enabled (boolean, default: true): Global master switch for rate limiting.
  • default_max_requests (integer, default: 100): Maximum requests allowed within the window.
  • default_window_seconds (integer, default: 60): Window duration in seconds.
  • trusted_proxy_ips (list[string], default: []): Trusted reverse proxy IP addresses or CIDR blocks (e.g. ["10.0.0.0/8"]). When configured, Kirak parses the rightmost untrusted IP from X-Forwarded-For. A request from one of these proxies may carry its own X-Request-ID, which becomes the request’s id; from any other client the id is generated by the server.
  • client_ip_header (string, default: ""): A header a trusted proxy sets to the client’s IP, such as cf-connecting-ip. On a request from a trusted_proxy_ips address Kirak reads it before X-Forwarded-For; a missing or invalid value falls back to X-Forwarded-For. Set it only when every request reaches the app through that proxy, or a client can send the header itself. See Reverse Proxy & Client IP Extraction.
7. Notifications (`notifications`)

Instances live under notifications.<channel>.providers (email, sms, push, im, webhook). Guide: Notifications.

notifications key Type Description
email_from_address string or null Sender address, e.g. no-reply@example.com.
email_from_name string or null Sender display name.
sms_from_number string or null SMS sender number or name, used when a provider instance sets none.
attachment_base_path string or null Directory email attachment paths are resolved from.
email object Email providers (e.g. aws_ses, sendgrid, smtp).
sms object SMS providers (e.g. aws_sns, twilio).
push object Push providers (e.g. firebase, apn, huawei).
im object Instant messaging providers (e.g. slack, discord, telegram).
webhook object Outgoing webhook providers (e.g. generic).

<INSTANCE> is the provider instance’s name in kirak.json, upper-cased: an instance named main reads ..._MAIN_....

email / aws_ses (pip install "kirak[notifications-ses]") – Email through Amazon SES.

Credential check (check()): GetSendQuota (also: is the account in the sandbox); a send-only IAM user cannot read it, so that result is unverified.

Name Where Required / default Description
aws_region kirak.json required AWS region, e.g. us-east-1.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_ACCESS_KEY environment AWS access key ID. Optional: boto3’s default credential chain is used when unset.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_SECRET_KEY environment AWS secret access key. Set together with the access key.

email / sendgrid (no extra install) – Email through SendGrid.

Credential check (check()): GET /v3/scopes; mail.send must be granted.

Name Where Required / default Description
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_API_KEY environment required SendGrid API key (starts with SG.).

email / smtp (no extra install) – Email through any SMTP server.

Credential check (check()): Connect, STARTTLS as configured, LOGIN, QUIT; nothing is sent.

Name Where Required / default Description
smtp_host kirak.json required SMTP server host.
smtp_port kirak.json default 587 SMTP server port.
smtp_use_tls kirak.json default True Use STARTTLS.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_USERNAME environment SMTP username. Leave unset for a server without authentication.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_PASSWORD environment SMTP password.

email / mailgun (no extra install) – Email through Mailgun.

Credential check (check()): GET /v3/domains/ (also: is the domain verified).

Name Where Required / default Description
domain kirak.json required Sending domain, e.g. mg.example.com.
region kirak.json default us Account region: us or eu.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_API_KEY environment required Mailgun API key.

email / postmark (no extra install) – Email through Postmark.

Credential check (check()): GET /server.

Name Where Required / default Description
message_stream kirak.json default outbound Message stream to send through.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_SERVER_TOKEN environment required Postmark server API token.

email / sparkpost (no extra install) – Email through SparkPost.

Credential check (check()): GET /api/v1/account; a send-only key cannot read it, so that result is unverified.

Name Where Required / default Description
region kirak.json default us Account region: us or eu.
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_API_KEY environment required SparkPost API key with the Transmissions: Read/Write permission.

email / brevo (no extra install) – Email through Brevo (formerly Sendinblue).

Credential check (check()): GET /v3/account.

Name Where Required / default Description
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_API_KEY environment required Brevo API key (xkeysib-…).

email / resend (no extra install) – Email through Resend.

Credential check (check()): GET /domains; a sending-only key is reported as valid.

Name Where Required / default Description
KIRAK_NOTIFICATION_EMAIL_<INSTANCE>_API_KEY environment required Resend API key (re_…).

sms / aws_sns (pip install "kirak[notifications-sns]") – SMS through Amazon SNS.

Credential check (check()): GetSMSSandboxAccountStatus.

Name Where Required / default Description
aws_region kirak.json required AWS region, e.g. us-east-1.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_ACCESS_KEY environment AWS access key ID. Optional: boto3’s default credential chain is used when unset.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_SECRET_KEY environment AWS secret access key. Set together with the access key.

sms / twilio (pip install "kirak[notifications-twilio]") – SMS through Twilio.

Credential check (check()): GET /2010-04-01/Accounts/.json (status, trial).

Name Where Required / default Description
from_number kirak.json Sender number. Default: notifications.sms_from_number.
messaging_service_sid kirak.json Twilio Messaging Service to send from; wins over from_number.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_ACCOUNT_SID environment required Twilio account SID.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_AUTH_TOKEN environment required Twilio auth token.

sms / vonage (no extra install) – SMS through Vonage (formerly Nexmo).

Credential check (check()): GET /account/get-balance.

Name Where Required / default Description
from_number kirak.json Sender: a phone number, or an alphanumeric sender ID where the provider and country allow one. Default: notifications.sms_from_number.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_API_KEY environment required Vonage API key.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_API_SECRET environment required Vonage API secret.

sms / plivo (no extra install) – SMS through Plivo.

Credential check (check()): GET /v1/Account/<auth_id>/.

Name Where Required / default Description
from_number kirak.json Sender: a phone number, or an alphanumeric sender ID where the provider and country allow one. Default: notifications.sms_from_number.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_AUTH_ID environment required Plivo Auth ID.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_AUTH_TOKEN environment required Plivo Auth Token.

sms / messagebird (no extra install) – SMS through MessageBird (Bird).

Credential check (check()): GET /balance.

Name Where Required / default Description
from_number kirak.json Sender: a phone number, or an alphanumeric sender ID where the provider and country allow one. Default: notifications.sms_from_number.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_ACCESS_KEY environment required MessageBird access key.

sms / africastalking (no extra install) – SMS through Africa’s Talking.

Credential check (check()): GET /version1/user (the account balance); username sandbox is test mode.

Name Where Required / default Description
username kirak.json required Africa’s Talking app username; sandbox uses the sandbox API.
from_number kirak.json Registered short code or alphanumeric sender ID. Default: notifications.sms_from_number, else Africa’s Talking’s shared sender.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_API_KEY environment required Africa’s Talking API key.

sms / termii (no extra install) – SMS through Termii.

Credential check (check()): GET /api/get-balance.

Name Where Required / default Description
base_url kirak.json default https://api.ng.termii.com Your account’s API base URL, shown on the Termii dashboard.
channel kirak.json default generic Route: generic (promotional) or dnd (transactional, e.g. OTPs; needs activation by Termii).
from_number kirak.json Sender: a phone number, or an alphanumeric sender ID where the provider and country allow one. Default: notifications.sms_from_number.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_API_KEY environment required Termii API key.

sms / fastsms (no extra install) – SMS through FastSMS (UK).

Credential check (check()): Action=CheckCredits.

Name Where Required / default Description
from_number kirak.json Sender: a phone number, or an alphanumeric sender ID where the provider and country allow one. Default: notifications.sms_from_number.
KIRAK_NOTIFICATION_SMS_<INSTANCE>_TOKEN environment required FastSMS API token (NetMessenger account settings).

push / firebase (no extra install) – Push notifications through Firebase Cloud Messaging.

Credential check (check()): An OAuth token for the service account, then a dry-run send to an invalid device token; nothing is delivered.

Name Where Required / default Description
firebase_project_id kirak.json Firebase project ID. Default: the project_id in the service account key.
KIRAK_NOTIFICATION_PUSH_<INSTANCE>_CREDENTIALS_JSON environment required Firebase service account key file contents (JSON, on one line).

push / apn (pip install "kirak[notifications-apn]") – Push notifications to Apple devices through APNs.

Credential check (check()): A push to an invalid device token; nothing is delivered.

Name Where Required / default Description
apn_key_path kirak.json required Path of the .p8 signing key file.
apn_key_id kirak.json required Key ID of the signing key.
apn_team_id kirak.json required Apple developer team ID.
apn_bundle_id kirak.json required App bundle ID (the APNs topic).
apn_use_sandbox kirak.json default False Send through the APNs sandbox (development builds).

push / huawei (no extra install) – Push notifications to Huawei devices through Push Kit.

Credential check (check()): POST the OAuth token URL (client credentials).

Name Where Required / default Description
app_id kirak.json required Huawei app ID.
KIRAK_NOTIFICATION_PUSH_<INSTANCE>_CLIENT_SECRET environment required Huawei app client secret.

push / expo (no extra install) – Push notifications to Expo apps through the Expo push service.

Credential check (check()): None: Expo has no endpoint that checks an access token without sending.

Name Where Required / default Description
KIRAK_NOTIFICATION_PUSH_<INSTANCE>_ACCESS_TOKEN environment Expo access token, needed only when push security is enabled for the project.

im / slack (no extra install) – Messages to Slack channels.

Credential check (check()): POST auth.test; the token must have chat:write.

Name Where Required / default Description
KIRAK_NOTIFICATION_IM_<INSTANCE>_BOT_TOKEN environment required Bot token.

im / discord (no extra install) – Messages to Discord channels.

Credential check (check()): GET /users/@me.

Name Where Required / default Description
KIRAK_NOTIFICATION_IM_<INSTANCE>_BOT_TOKEN environment required Bot token.

im / telegram (no extra install) – Messages to Telegram chats.

Credential check (check()): getMe.

Name Where Required / default Description
KIRAK_NOTIFICATION_IM_<INSTANCE>_BOT_TOKEN environment required Bot token.

webhook / generic (no extra install) – Signed HTTP POST to your own systems.

Credential check (check()): None: a receiver can only be tested by sending to it; the url is checked.

Name Where Required / default Description
url kirak.json Destination URL.
allow_url_override kirak.json default False Let a call pass its own destination URL.
timeout kirak.json default 10.0 Request timeout in seconds.
KIRAK_NOTIFICATION_WEBHOOK_<INSTANCE>_SECRET_KEY environment HMAC signing key; requests are unsigned when unset.
8. Payments (`payments`)

Instances live under payments.providers. Guide: Payments.

payments key Type Description
default_provider string Instance name used when a call names no provider. Must be one of the instances under providers.
providers object Payment provider instances (types stripe, stripe_connect, razorpay, square, or a custom type), by instance name.
success_url string or null Redirect after a successful payment; a path is prefixed with base_url. Each provider instance can override it.
cancel_url string or null Redirect after a cancelled payment; a path is prefixed with base_url. Each provider instance can override it.
require_auth boolean Require a signed-in caller on the payment routes. false lets guests check out (initiate_payment, connect_checkout, verify_payment, list_providers); owner and admin operations stay protected either way. Default true.
plan_catalog boolean Allow ensure_plan to create subscription plans on the provider account. Default false.

<INSTANCE> is the provider instance’s name in kirak.json, upper-cased: an instance named main reads ..._MAIN_....

stripe (no extra install) – Stripe Checkout, subscriptions, saved payment methods, off-session charges and disputes.

Credential check (check()): GET /v1/balance.

Name Where Required / default Description
success_url kirak.json default /payment/success URL Stripe returns the buyer to after a successful payment; a path is prefixed with base_url. Stripe refuses a relative URL, so a path without base_url cannot create a checkout. Overrides payments.success_url.
cancel_url kirak.json default /payment/cancel URL Stripe returns the buyer to after a cancelled payment; a path is prefixed with base_url. Stripe refuses a relative URL, so a path without base_url cannot create a checkout. Overrides payments.cancel_url.
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
KIRAK_PAYMENT_<INSTANCE>_SECRET_KEY environment required Stripe secret API key (sk_live_… or sk_test_…).
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment Webhook signing secret (whsec_…); without it every webhook is refused.

stripe_connect (no extra install) – Stripe Connect marketplace: merchant onboarding, checkout on behalf of merchants, platform fees.

Credential check (check()): GET /v1/account (the platform account).

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
success_url kirak.json default /payment/success URL Stripe returns the buyer to after a successful payment; a path is prefixed with base_url. Stripe refuses a relative URL, so a path without base_url cannot create a checkout. Overrides payments.success_url.
cancel_url kirak.json default /payment/cancel URL Stripe returns the buyer to after a cancelled payment; a path is prefixed with base_url. Stripe refuses a relative URL, so a path without base_url cannot create a checkout. Overrides payments.cancel_url.
refresh_url kirak.json default /connect/onboard/refresh Onboarding URL Stripe sends a merchant back to when a link expired; a path is prefixed with base_url.
return_url kirak.json default /connect/onboard/return URL Stripe sends a merchant to after onboarding; a path is prefixed with base_url.
platform_fee_percent kirak.json default 10.0 Platform fee, in percent (0 to 100), of a merchant onboarded without one. update_merchant_fee sets a merchant’s own.
KIRAK_PAYMENT_<INSTANCE>_SECRET_KEY environment required Stripe secret API key of the platform account.
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment Signing secret of the connected-accounts webhook endpoint.
KIRAK_PAYMENT_<INSTANCE>_PLATFORM_WEBHOOK_SECRET environment Signing secret of the platform-account webhook endpoint (checkout, refunds, saved methods).

razorpay (pip install "kirak[payments-razorpay]") – Razorpay payments, subscriptions, saved payment methods (mandates) and disputes.

Credential check (check()): GET /v1/payments?count=1.

Name Where Required / default Description
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
cancel_url kirak.json default /payment/cancel Redirect after a cancelled payment; a path is prefixed with base_url. Overrides payments.cancel_url.
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
KIRAK_PAYMENT_<INSTANCE>_KEY_ID environment required Razorpay key ID (rzp_live_… or rzp_test_…).
KIRAK_PAYMENT_<INSTANCE>_KEY_SECRET environment required Razorpay key secret.
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment Webhook secret; needed to verify webhooks.

square (pip install "kirak[payments-square]") – Square payments, subscriptions, saved cards and disputes.

Credential check (check()): GET /v2/locations/<location_id>.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
location_id kirak.json required Square location that takes the payments.
environment kirak.json default sandbox “sandbox” or “production”.
webhook_notification_url kirak.json The exact public URL Square posts webhooks to; part of the signature check.
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
cancel_url kirak.json default /payment/cancel Redirect after a cancelled payment; a path is prefixed with base_url. Overrides payments.cancel_url.
KIRAK_PAYMENT_<INSTANCE>_ACCESS_TOKEN environment required Square access token (production or sandbox).
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SIGNATURE_KEY environment Webhook signature key; needed to verify webhooks.

paypal (no extra install) – PayPal Checkout: one-time payments, subscriptions, vaulted PayPal accounts, off-session charges and disputes.

Credential check (check()): POST /v1/oauth2/token; then GET the webhook named by webhook_id.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default sandbox “sandbox” or “live”.
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
cancel_url kirak.json default /payment/cancel Redirect after a cancelled payment; a path is prefixed with base_url. Overrides payments.cancel_url.
KIRAK_PAYMENT_<INSTANCE>_CLIENT_ID environment required PayPal REST app client ID.
KIRAK_PAYMENT_<INSTANCE>_CLIENT_SECRET environment required PayPal REST app secret.
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_ID environment ID of the webhook registered in the app; needed to verify webhooks.

paddle (no extra install) – Paddle Billing (merchant of record): one-time payments, subscriptions and one-time charges on a subscription.

Credential check (check()): GET /event-types.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default sandbox “sandbox” or “production”.
default_tax_category kirak.json default standard Tax category of the product created for a payment without price_id.
checkout_url kirak.json Approved page that loads Paddle.js; the account’s default payment link otherwise.
KIRAK_PAYMENT_<INSTANCE>_API_KEY environment required Paddle API key.
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment Secret of the notification destination; needed to verify webhooks.

paystack (no extra install) – Paystack: one-time payments, subscriptions, saved cards, off-session charges and disputes (read-only).

Credential check (check()): GET /balance.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default test “test” or “live”; must match the secret key.
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
KIRAK_PAYMENT_<INSTANCE>_SECRET_KEY environment required Paystack secret key (sk_test_… or sk_live_…); also verifies webhooks.

flutterwave (no extra install) – Flutterwave (API v3): one-time payments, subscriptions, saved cards, off-session charges and disputes (read-only).

Credential check (check()): GET /v3/balances.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default test “test” or “live”; must match the secret key.
country kirak.json Two-letter country code of the account; needed for off-session charges.
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
KIRAK_PAYMENT_<INSTANCE>_SECRET_KEY environment required Flutterwave secret key (FLWSECK_TEST-… or FLWSECK-…).
KIRAK_PAYMENT_<INSTANCE>_SECRET_HASH environment required Secret hash set on the webhook; verifies webhooks.

mercadopago (no extra install) – Mercado Pago: Checkout Pro payments, subscriptions (preapprovals) and disputes (read-only).

Credential check (check()): GET /users/me.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default sandbox “sandbox” or “production”.
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
KIRAK_PAYMENT_<INSTANCE>_ACCESS_TOKEN environment required Mercado Pago access token.
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment required Secret signature of the webhook; verifies webhooks.

xendit (no extra install) – Xendit Invoices: one-time payments and refunds.

Credential check (check()): GET /balance.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default test “test” or “live”; must match the secret key.
success_url kirak.json default /payment/success Redirect after a successful payment; a path is prefixed with base_url. Overrides payments.success_url.
KIRAK_PAYMENT_<INSTANCE>_SECRET_KEY environment required Xendit secret API key (xnd_development_… or xnd_production_…).
KIRAK_PAYMENT_<INSTANCE>_CALLBACK_TOKEN environment required Callback verification token; verifies webhooks.

airwallex (no extra install) – Airwallex Payment Links: one-time payments, refunds and disputes (read-only).

Credential check (check()): POST /api/v1/authentication/login.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default sandbox “sandbox” or “production”.
KIRAK_PAYMENT_<INSTANCE>_CLIENT_ID environment required Airwallex API client ID.
KIRAK_PAYMENT_<INSTANCE>_API_KEY environment required Airwallex API key.
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment required Secret of the webhook; verifies webhooks.

omise (no extra install) – Omise (Opn Payments) Links: one-time payments, refunds and disputes (read-only).

Credential check (check()): GET /account.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
environment kirak.json default test “test” or “live”; must match the secret key.
KIRAK_PAYMENT_<INSTANCE>_SECRET_KEY environment required Omise secret key (skey_test_… or skey_…).
KIRAK_PAYMENT_<INSTANCE>_WEBHOOK_SECRET environment Base64 webhook secret; without it each webhook is verified by reading its event back.

telr (no extra install) – Telr Hosted Payment Page: one-time payments; refunds made in the Telr admin are recorded.

Credential check (check()): None: Telr has no read-only call; the offline checks run.

Name Where Required / default Description
timeout kirak.json default 15 Seconds one gateway call may take before it fails with 502.
store_id kirak.json required Numeric Telr store ID.
environment kirak.json default test “test” or “live”.
success_url kirak.json required Absolute URL Telr returns the buyer to after paying, declining or cancelling.
KIRAK_PAYMENT_<INSTANCE>_AUTH_KEY environment required Authentication key of the Hosted Payment Page.
KIRAK_PAYMENT_<INSTANCE>_ADVICE_SECRET environment required Secret key of the transaction advice; verifies webhooks.
9. Integrations (`integrations`)

Instances live under integrations.providers. Guide: Integrations.

integrations key Type Description
providers object Integration instances (types oauth2, api_key), by name. type may be left out when the instance names a profile.

<INSTANCE> is the provider instance’s name in kirak.json, upper-cased: an instance named main reads ..._MAIN_....

oauth2 (no extra install) – An OAuth 2 provider. Each user connects their own account.

Credential check (check()): the token endpoint with the client credentials, once a profile or token_url is known.

Name Where Required / default Description
base_url kirak.json API base URL, https. Required unless the profile gives one. Relative paths in client() resolve against it.
settings kirak.json Values the profile asks for, such as a tenant (Microsoft) or a shop (Shopify).
client_id kirak.json required The app’s OAuth client id.
profile kirak.json A profile name (bundled or in integrations/) that fills the URLs, default scopes, PKCE and the account lookup.
authorize_url kirak.json Authorize endpoint, https. Needed without a profile.
token_url kirak.json Token endpoint, https. Needed without a profile.
refresh_url kirak.json Refresh endpoint, https. Defaults to token_url.
revoke_url kirak.json Revoke endpoint, https. Used on disconnect when it is set.
scope kirak.json Scopes to ask for. Replaces the profile’s default scopes. A list, or a space or comma separated string.
authorize_params kirak.json Extra query parameters on the authorize URL.
pkce kirak.json S256 PKCE. Default from the profile, else true.
grant kirak.json authorization_code (default): each user connects their account. client_credentials: one app-level token for the instance, no user; the profile must list it in auth.grants.
token_auth kirak.json How the client proves itself at the token endpoint: basic (default) or body send the id and secret; private_key_jwt sends a signed JWT; none is a public client that sends only its id, with PKCE, and has no secret. Default from the profile.
allowed_hosts kirak.json Extra hosts the client may call. The base_url host is always allowed.
multiple_accounts kirak.json Allow more than one connection per user. Default false.
timeout kirak.json Request timeout in seconds. Default 30.
audit_requests kirak.json Record each outgoing call (method, host, path, status, duration, size) in integration_calls, when monitoring is on. Default false.
audit_sample_rate kirak.json The share of calls recorded when audit_requests is on, from 0 to 1. Default 1.
KIRAK_INTEGRATION_<INSTANCE>_CLIENT_SECRET environment required The OAuth client secret.
KIRAK_INTEGRATION_<INSTANCE>_WEBHOOK_SECRET environment Checks webhook signatures, when the profile signs them with it.
KIRAK_INTEGRATION_<INSTANCE>_PRIVATE_KEY environment The PEM private key that signs the client’s JWT, for a profile with token_auth private_key_jwt.

api_key (no extra install) – An API key. The app’s own key from the environment, or one key each user saves.

Credential check (check()): the profile’s verify request with the key, once a profile or verify is set.

Name Where Required / default Description
base_url kirak.json API base URL, https. Required unless the profile gives one. Relative paths in client() resolve against it.
settings kirak.json Values the profile asks for, such as a tenant or a shop.
key_owner kirak.json required app: one key from the environment. user: each user saves their own. Required.
auth kirak.json Where the key goes: in (header, query or basic), name (header or query), an optional prefix (header), and a fixed password (basic: the key is the user name).
profile kirak.json A profile name (bundled or in integrations/) that fills the verify request and the auth placement.
verify kirak.json One request that proves the key works: method and path.
allowed_hosts kirak.json Extra hosts the client may call. The base_url host is always allowed.
multiple_accounts kirak.json Allow more than one saved key per user (key_owner user). Default false.
timeout kirak.json Request timeout in seconds. Default 30.
audit_requests kirak.json Record each outgoing call (method, host, path, status, duration, size) in integration_calls, when monitoring is on. Default false.
audit_sample_rate kirak.json The share of calls recorded when audit_requests is on, from 0 to 1. Default 1.
KIRAK_INTEGRATION_<INSTANCE>_API_KEY environment The app’s key, when key_owner is app. Users save their own keys in the app.
KIRAK_INTEGRATION_<INSTANCE>_WEBHOOK_SECRET environment Checks webhook signatures, when the profile signs them with it.
10. Storage (`storage`)

Instances live under storage.providers. Guide: Storage.

storage key Type Description
default_provider string Instance name used when a call names no provider. Must be one of the instances under providers.
providers object Storage provider instances (types local, aws, wasabi, r2, spaces, cubbit, ovh, b2, gcs, azure, or a custom type), by instance name.
image_allowed_types string Allowed image extensions, comma-separated. Default “jpg,jpeg,png,webp,gif”. svg is refused: store vector files with upload_file.
image_max_size string Maximum image upload size, e.g. “5mb”. Default “5mb”.
image_compress_quality integer JPEG/WebP compression quality. Default 85.
image_max_width integer Maximum stored image width in pixels; larger images are scaled down. Default 2000.
image_max_height integer Maximum stored image height in pixels; larger images are scaled down. Default 2000.
file_allowed_types string Allowed non-image extensions, comma-separated. Default “pdf,doc,docx,xls,xlsx,csv,txt,zip”.
file_max_size string Maximum file upload size, e.g. “25mb”. Default “10mb”.
default_thumbnails string or null Thumbnails generated for every image upload, e.g. “sm:100x100,md:300x300”. Default none.
thumbnail_mode string sync makes thumbnails before responding; background responds first. Default sync.
signed_url_ttl integer Lifetime in seconds of a signed URL for a private instance when get_url is called without expires. Default 3600 (1 hour).

<INSTANCE> is the provider instance’s name in kirak.json, upper-cased: an instance named main reads ..._MAIN_....

local (no extra install) – Files on the app’s own disk, served at /media/.

Credential check (check()): upload_dir is (or can be created) readable and writable where the check runs.

Name Where Required / default Description
upload_dir kirak.json default assets/media Directory uploads are written to. Two local instances need different ones.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.

aws (pip install "kirak[storage]") – Amazon S3, or any S3-compatible service through endpoint_url.

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
aws_bucket kirak.json required Bucket name.
aws_region kirak.json default us-east-1 Bucket region.
endpoint_url kirak.json Custom S3 endpoint; leave unset for AWS.
public_url kirak.json Base URL of returned file URLs, e.g. a CDN or custom domain in front of the bucket. Unset: the bucket’s own URL.
acl kirak.json Canned ACL set on each upload: private or public-read. Unset: none is sent, as buckets with ACLs disabled (the AWS default) require.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment Access key ID. Optional: boto3’s default credential chain is used when unset.
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment Secret access key. Set together with the access key.

wasabi (pip install "kirak[storage]") – Wasabi object storage (S3-compatible).

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
aws_bucket kirak.json required Bucket name.
aws_region kirak.json default us-east-1 Bucket region.
endpoint_url kirak.json default https://s3.wasabisys.com Wasabi endpoint.
public_url kirak.json Base URL of returned file URLs, e.g. a CDN or custom domain in front of the bucket. Unset: the bucket’s own URL.
acl kirak.json Canned ACL set on each upload: private or public-read. Unset: none is sent, as buckets with ACLs disabled (the AWS default) require.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment Access key ID. Optional: boto3’s default credential chain is used when unset.
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment Secret access key. Set together with the access key.

r2 (pip install "kirak[storage]") – Cloudflare R2 (S3-compatible). Returned URLs are public only through public_url.

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
account_id kirak.json required Cloudflare account id (32 hex characters); sets the endpoint.
aws_bucket kirak.json required Bucket name.
jurisdiction kirak.json default default Where the bucket’s data is kept: default, eu or fedramp. Must match the bucket.
aws_region kirak.json default auto Leave unset: R2 ignores it.
endpoint_url kirak.json Leave unset: built from account_id and jurisdiction.
public_url kirak.json Base URL of returned file URLs: the bucket’s r2.dev subdomain or a custom domain bound to it. Unset: URLs point at the S3 endpoint, which is never public; use get_url with expires.
acl kirak.json Leave unset: R2 has no object ACLs, so setting it is an error.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment required Access key ID.
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment required Secret access key.

spaces (pip install "kirak[storage]") – DigitalOcean Spaces (S3-compatible).

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
aws_bucket kirak.json required Space (bucket) name.
aws_region kirak.json required Datacenter region of the Space, e.g. nyc3 or fra1; sets the endpoint.
endpoint_url kirak.json Leave unset: https://<aws_region>.digitaloceanspaces.com.
public_url kirak.json Base URL of returned file URLs, e.g. the Spaces CDN https://..cdn.digitaloceanspaces.com or a custom domain. Unset: https://..digitaloceanspaces.com.
acl kirak.json default public-read Canned ACL set on each upload: public-read (files readable by URL) or private.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment required Access key ID.
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment required Secret access key.

cubbit (pip install "kirak[storage]") – Cubbit DS3, European geo-distributed object storage (S3-compatible).

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
aws_bucket kirak.json required Bucket name.
aws_region kirak.json default eu-west-1 Signing region.
endpoint_url kirak.json default https://s3.cubbit.eu Cubbit endpoint; https://s3..cubbit.eu for a custom tenant.
public_url kirak.json Base URL of returned file URLs, e.g. a CDN or custom domain in front of the bucket. Unset: the bucket’s own URL.
acl kirak.json Canned ACL set on each upload: private or public-read. Unset: none is sent, as buckets with ACLs disabled (the AWS default) require.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment required Access key ID.
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment required Secret access key.

ovh (pip install "kirak[storage]") – OVHcloud Object Storage (S3-compatible).

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
aws_bucket kirak.json required Bucket name.
aws_region kirak.json required Region code in lower case, e.g. gra, sbg, de, uk or eu-west-par; sets the endpoint.
endpoint_url kirak.json Leave unset: https://s3.<aws_region>.io.cloud.ovh.net.
public_url kirak.json Base URL of returned file URLs, e.g. a CDN or custom domain. Unset: https://.s3..io.cloud.ovh.net.
acl kirak.json Canned ACL set on each upload: private or public-read. Unset: none is sent (files are private unless a bucket policy makes them public).
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment required Access key ID.
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment required Secret access key.

b2 (pip install "kirak[storage]") – Backblaze B2 (S3-compatible).

Credential check (check()): ListObjectsV2 (MaxKeys=1); with write, PutObject and DeleteObject of one object.

Name Where Required / default Description
aws_bucket kirak.json required Bucket name.
aws_region kirak.json required Region of the bucket’s S3 endpoint, e.g. us-west-004; sets the endpoint.
endpoint_url kirak.json Leave unset: https://s3.<aws_region>.backblazeb2.com.
public_url kirak.json Base URL of returned file URLs, e.g. a CDN or the bucket’s friendly URL https://f004.backblazeb2.com/file/. Unset: https://s3..backblazeb2.com/, public when the bucket is.
acl kirak.json Leave unset: B2 sets ACLs per bucket, so setting it is an error.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_ACCESS_KEY environment required Application key ID (keyID).
KIRAK_STORAGE_<INSTANCE>_SECRET_KEY environment required Application key (applicationKey).

gcs (pip install "kirak[storage-gcs]") – Google Cloud Storage, with a service account key or Application Default Credentials.

Credential check (check()): objects.list (maxResults=1); with write, objects.insert and objects.delete of one object; under ADC with signing_service_account, IAM signBlob of one URL.

Name Where Required / default Description
bucket kirak.json required Bucket name.
project_id kirak.json Project id. Unset: the key’s project, or the ADC project.
public_url kirak.json Base URL of returned file URLs, e.g. a Cloud CDN or load balancer domain. Unset: https://storage.googleapis.com/, readable only if the bucket grants allUsers read.
signing_service_account kirak.json Service account email that signs URLs (get_url with expires) under Application Default Credentials; the app’s identity needs iam.serviceAccounts.signBlob on it. Not needed with credentials_json.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_CREDENTIALS_JSON environment Service account key file contents (JSON). Optional: Application Default Credentials are used when unset.

azure (pip install "kirak[storage-azure]") – Azure Blob Storage, with a connection string, an account key or the app’s Azure identity.

Credential check (check()): List Blobs (maxresults=1); with write, Put Blob and Delete Blob of one blob; under an Azure identity, Get User Delegation Key.

Name Where Required / default Description
container kirak.json required Container name.
account_name kirak.json Storage account name. Required unless connection_string is set.
account_url kirak.json Blob endpoint, for sovereign clouds or Azurite. Unset: https://<account_name>.blob.core.windows.net.
public_url kirak.json Base URL of returned file URLs, e.g. an Azure Front Door or CDN domain. Unset: the blob’s own URL, readable only if the container allows anonymous blob access.
visibility kirak.json default private public or private. private (the default): get_url returns a signed URL that expires after storage.signed_url_ttl, and a local instance serves files only through a signature-checked route; nobody can read a file by guessing its path. public: get_url returns a permanent, unauthenticated URL, and a local instance serves its directory as static files. Choose public deliberately for assets meant to be world-readable.
KIRAK_STORAGE_<INSTANCE>_CONNECTION_STRING environment Storage account connection string. Optional: account_name with account_key, or the app’s Azure identity, is used when unset.
KIRAK_STORAGE_<INSTANCE>_ACCOUNT_KEY environment Storage account access key, used with account_name. Optional: without it the app’s Azure identity (DefaultAzureCredential) is used.
11. Scheduler (`scheduler`)

Guide: Scheduler.

scheduler key Type Description
mode string loops: the process runs its own cron and queue loops. tick: no background loops; an external caller drives the scheduler through POST /_kirak/scheduler/tick. Default loops.
min_interval_seconds integer Tick mode only: the shortest gap in seconds between two firings of any cron, registered in code or created at runtime; a cron that fires closer together is refused (at startup, or with 422 on a schedule write). Default 900.
next_due_webhook_url string Tick mode only: a URL the scheduler POSTs {“next_due”: T} to after each schedule or enqueue write, with the tick token in X-Kirak-Tick-Token. Tried twice within 2 s in total; a failure is logged, not returned. Empty (default): no notify.
default_provider string Instance name used when a call names no provider. Must be one of the instances under providers.
providers object Queue provider instances (types database, redis, rabbitmq, or a custom type), by instance name. At most one database entry.
poll_interval integer Seconds between queue polls (database and redis providers). Default 5.
concurrency integer Maximum jobs run in parallel per provider. Default 4.
default_queue string Queue used when enqueue() is given none. Always consumed. Default “default”.
queues array Extra queues to consume besides default_queue. Default [].
job_timeout number Seconds a job may run before the worker stops and retries it; fractions allowed (e.g. 0.25). In tick mode a job starts only if its timeout fits the remaining tick budget, and the timeout must be at most 20 s. Default 3600 in loops mode and 20 in tick mode.
max_retries integer Default maximum retry attempts per job. Default 3.
retry_backoff integer Base delay between retries in seconds, multiplied by the attempt number. Default 60.
job_retention_days integer Days a finished (done or failed) job is kept before it is removed: database rows by a daily cleanup, Redis job records by an expiry. 0 keeps them forever. Pending, running and retrying jobs are never removed. Default 7.
max_jobs_per_tick integer Tick mode only: the most jobs one tick starts, whatever budget is left. Jobs not started stay due for the next tick. Unset: no cap.

<INSTANCE> is the provider instance’s name in kirak.json, upper-cased: an instance named main reads ..._MAIN_....

database (no extra install) – Queue in the app’s own database. No extra install. At most one per project.

No settings or secrets.

redis (pip install "kirak[scheduler-redis]") – Queue in Redis (sorted sets).

Credential check (check()): Connect and PING.

Name Where Required / default Description
redis_ssl kirak.json default False Connect over TLS.
KIRAK_SCHEDULER_<INSTANCE>_URL environment Redis URL. Default redis://localhost:6379.

rabbitmq (pip install "kirak[scheduler-rabbitmq]") – Queue in RabbitMQ. Loops mode only: no job records, job listing or cancel, or database schedules.

Credential check (check()): Connect and open a channel.

Name Where Required / default Description
consumer_timeout kirak.json default 1800 The broker’s consumer_timeout in seconds. Jobs on this provider are stopped 60 s before it, if that is below job_timeout.
KIRAK_SCHEDULER_<INSTANCE>_URL environment AMQP URL. Default amqp://guest:guest@localhost/.
12. AI (`ai`)

Guide: AI.

ai key Type Description
default_model string “provider:model” used when an agent or call names no model.
conversation_ttl_seconds integer Seconds a saved agent conversation is kept. Default 3600.
compaction_token_threshold integer or null Token count at which a long conversation is compacted. null turns compaction off. Default 150000.
request_timeout_seconds integer Read timeout in seconds for each model-provider call. A hung provider fails after this instead of hanging. Default 60.
model_prices object Prices in USD per 1M tokens, by model string, for models genai-prices does not price (e.g. models on Amazon Bedrock’s OpenAI-compatible endpoint). Used for a run’s cost and an agent’s max_budget_usd; a price here wins over genai-prices’. Not needed for models genai-prices lists.
Provider Model prefixes Install API key variable
openai openai:, openai-responses: pip install "kirak[ai-openai]" OPENAI_API_KEY
anthropic anthropic: pip install "kirak[ai-anthropic]" ANTHROPIC_API_KEY
google google-gla:, google: pip install "kirak[ai-google]" GOOGLE_API_KEY, GEMINI_API_KEY
13. Vector (`vector`)

Instances live under vector.store.providers and vector.embedding.providers. Guide: Vector.

vector key Type Description
store object Vector store providers (e.g. pinecone, s3_vectors).
embedding object Embedding providers (e.g. openai, google, ollama).

<INSTANCE> is the provider instance’s name in kirak.json, upper-cased: an instance named main reads ..._MAIN_....

store / pinecone (no extra install) – Pinecone serverless indexes.

Credential check (check()): GET /indexes.

Name Where Required / default Description
cloud kirak.json default aws Cloud of new indexes.
region kirak.json default us-east-1 Region of new indexes.
api_version kirak.json default 2026-04 Pinecone API version.
batch_size kirak.json default 100 Vectors per upsert request (at most 1000).
ready_timeout kirak.json default 120 Seconds create_index waits for the index to be ready.
max_retries kirak.json default 3 Retries on rate limits and server errors.
timeout kirak.json default 30.0 Request timeout in seconds.
KIRAK_VECTOR_STORE_<INSTANCE>_API_KEY environment required Pinecone API key.

store / s3_vectors (pip install "kirak[vector-s3vectors]") – Amazon S3 Vectors indexes in an existing vector bucket.

Credential check (check()): GetVectorBucket on the configured bucket.

Name Where Required / default Description
bucket kirak.json required Existing vector bucket.
region kirak.json required Bucket region.
non_filterable_metadata_keys kirak.json Metadata keys stored but not usable in filters, for new indexes.
max_retries kirak.json default 3 Retries on rate limits and server errors.
KIRAK_VECTOR_STORE_<INSTANCE>_ACCESS_KEY_ID environment AWS access key ID. Optional: boto3’s default credential chain is used when unset.
KIRAK_VECTOR_STORE_<INSTANCE>_SECRET_ACCESS_KEY environment AWS secret access key. Set together with the access key ID.

embedding / openai (no extra install) – OpenAI embeddings, or any OpenAI-compatible endpoint through base_url.

Credential check (check()): GET /models; the configured model must be listed.

Name Where Required / default Description
model kirak.json required Embedding model name.
base_url kirak.json default https://api.openai.com/v1 API base URL.
dimensions kirak.json Output vector length, for models that can shorten it.
batch_size kirak.json default 100 Texts per request (at most 2048).
max_retries kirak.json default 3 Retries on rate limits and server errors.
timeout kirak.json default 30.0 Request timeout in seconds.
KIRAK_VECTOR_EMBEDDING_<INSTANCE>_API_KEY environment required OpenAI API key.

embedding / google (no extra install) – Google Gemini embeddings.

Credential check (check()): GET /models/.

Name Where Required / default Description
model kirak.json required Embedding model name.
dimensions kirak.json Output vector length, for models that can shorten it.
batch_size kirak.json default 100 Texts per request (at most 100).
max_retries kirak.json default 3 Retries on rate limits and server errors.
timeout kirak.json default 30.0 Request timeout in seconds.
KIRAK_VECTOR_EMBEDDING_<INSTANCE>_API_KEY environment required Gemini API key.

embedding / ollama (no extra install) – Embeddings from a local or self-hosted Ollama server.

Credential check (check()): GET /api/tags; the configured model must be pulled.

Name Where Required / default Description
model kirak.json required Embedding model name.
base_url kirak.json default http://localhost:11434 Ollama server URL.
batch_size kirak.json default 100 Texts per request.
max_retries kirak.json default 3 Retries on rate limits and server errors.
timeout kirak.json default 30.0 Request timeout in seconds.
14. Monitoring (`monitoring`)

Guide: Monitoring.

monitoring key Type Description
sinks array Where records are written. “sqlite”: the local metrics file, which the query endpoints and alerts read. “stdout”: one JSON line per record, for the platform’s log collector on stateless instances. Default [“sqlite”].
db_path string Path of the SQLite metrics file (sqlite sink only). Default “var/kirak/metrics.db”.
batch_interval_seconds integer Seconds between writes of collected data. Default 5.
retention_days integer Days metrics are kept (sqlite sink only). Default 7.
audit_retention_days integer Days audit events are kept (sqlite sink only), apart from retention_days. Default 30.
sample_rate number Share of requests whose per-operation timings (request steps) are recorded, from 0 to 1; every request itself is recorded. Default 1.0.
slow_request_threshold_ms integer Operations taking at least this many milliseconds have their timing recorded whatever sample_rate. Default 500.
max_db_size_mb integer Size cap of the metrics file in megabytes (sqlite sink only). Default 200.
queue_max_size integer Maximum records (requests, audit, AI) waiting in memory to be written. Default 10000.
log_capture_level string Lowest level of captured log records. Default WARNING.
log_queue_max_size integer Maximum log records waiting to be written. Default 5000.
15. MCP (`mcp`)

Guide: MCP. allowed_hosts lists the Host names the MCP endpoints accept, without a port; left empty, the host of base_url is accepted, and with neither set the Host header is not checked. A request with another Host gets 400 before any credential is read.

mcp key Type Description
allowed_hosts array Host names, without a port, that the MCP endpoints accept (e.g. mcp.example.com). Default: the host of base_url. With neither set, the Host header is not checked.

Environment variables provide secret credentials to Kirak modules.

Every variable Kirak and the kirak CLI read by a fixed name:

Variable Read by Required Secret Purpose
DB_PASSWORD core yes Database password; every other database setting is in kirak.json “database”.
KIRAK_REDIS_URL core yes Redis URL. When set, rate limiting, used one-time sign-in codes and nonces, OTP storage and model caching use Redis instead of the database.
KIRAK_AUTH_JWT_SECRET_KEY auth yes yes Signs access tokens (at least 32 bytes). Also the fallback of the other auth secrets.
KIRAK_AUTH_JWT_REFRESH_SECRET_KEY auth yes Signs refresh tokens. Default: KIRAK_AUTH_JWT_SECRET_KEY; set a separate one in production.
KIRAK_AUTH_JWT_OLD_SECRET_KEY auth yes Previous access-token key, during a key rotation, so tokens it signed stay valid until they expire.
KIRAK_AUTH_JWT_REFRESH_OLD_SECRET_KEY auth yes Previous refresh-token key, during a key rotation. Default: KIRAK_AUTH_JWT_OLD_SECRET_KEY.
KIRAK_AUTH_VERIFICATION_KEY auth yes yes Fernet key signing email verification and password reset links, and encrypting social sign-in codes.
KIRAK_AUTH_ENCRYPTION_KEYS auth yes Comma-separated base64 keys (32 bytes each; startup refuses any other entry) encrypting social login data, MFA secrets and integration credentials. The first key encrypts; every listed key decrypts, so a new key goes first when rotating. Default: derived from KIRAK_AUTH_JWT_SECRET_KEY, with a warning; set it in production.
KIRAK_AUTH_API_KEY_SECRET auth yes Keys the stored hash of API keys, so rotating KIRAK_AUTH_JWT_SECRET_KEY does not invalidate them. Default: KIRAK_AUTH_JWT_SECRET_KEY; set it in production. Setting or changing it invalidates every existing API key.
KIRAK_MONITORING_INGESTION_KEY monitoring yes Bearer token required on every /monitoring/* endpoint except /monitoring/ping. Unset: those endpoints answer 503.
KIRAK_SCHEDULER_TICK_TOKEN scheduler yes Shared secret for POST /_kirak/scheduler/tick in tick mode, sent in the X-Kirak-Tick-Token header. Unset: the route answers 404.
KIRAK_STORAGE_URL_SIGNING_KEY storage yes Signs the URLs of private local instances (any length). Default: KIRAK_AUTH_JWT_SECRET_KEY. A private local instance cannot start without one.
KIRAK_API_KEY kirak CLI yes Deploy service API key for kirak deploy, kirak logs and kirak env push, in place of kirak login (CI). Used before the stored login token.
KIRAK_STUDIO_URL kirak CLI Address of the deploy service that kirak login, kirak deploy, kirak logs and kirak env push talk to.
KIRAK_SKIP_VERSION_CHECK kirak CLI Any value turns off the CLI’s check for a newer kirak release.
PORT kirak CLI Local port kirak run serves the project on when --port is not given.
APPDATA kirak CLI Windows only: the folder the CLI stores its login token and version check in (set by Windows; elsewhere the home folder).

A provider instance reads its secrets from <PREFIX>_<INSTANCE>_<FIELD>, the instance name and field upper-cased. The fields of each provider are in its module’s block above.

Module Pattern Example
Notifications KIRAK_NOTIFICATION_<CHANNEL>_<INSTANCE>_<FIELD> (EMAIL, SMS, PUSH, IM, WEBHOOK) KIRAK_NOTIFICATION_SMS_TWILIO_ALERTS_AUTH_TOKEN
Payments KIRAK_PAYMENT_<INSTANCE>_<FIELD> KIRAK_PAYMENT_STRIPE_US_SECRET_KEY
Integrations KIRAK_INTEGRATION_<INSTANCE>_<FIELD> KIRAK_INTEGRATION_GITHUB_CLIENT_SECRET
Storage KIRAK_STORAGE_<INSTANCE>_<FIELD> KIRAK_STORAGE_S3_MEDIA_SECRET_KEY
Scheduler KIRAK_SCHEDULER_<INSTANCE>_<FIELD> KIRAK_SCHEDULER_JOBS_URL (Redis or AMQP URL)
Vector KIRAK_VECTOR_STORE_<INSTANCE>_<FIELD>, KIRAK_VECTOR_EMBEDDING_<INSTANCE>_<FIELD> KIRAK_VECTOR_STORE_DOCS_API_KEY

Social login secrets follow social-auth-core’s own convention, SOCIAL_AUTH_<BACKEND>_SECRET (SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET); see the Social Providers Reference. kirak env lists every variable the project needs and whether it is set.


Verify your configuration before deployment using the Kirak CLI:

Terminal window
# Check syntax, schema rules, and inter-file references
kirak validate
# Check that all required environment variables are configured
kirak env
# Compare your model configuration against applied database migrations
kirak db status