Skip to main content

Configuration and operations

This guide turns a first call into an operable integration. Values are examples; calculate caps and RPM from your actual volume.

1. Assign keys by responsibility​

A useful split:

  • app-production: production backend, static IP, minimum models and approved caps.
  • app-staging: reduced budget and RPM.
  • documents-ocr: only the document flow and its models.
  • notebook-dev: individual access, never shared with production.

Each key supports:

ControlEffect
allowed_modelsClosed model list; empty/NULL allows the available catalog
allowed_ipsExact IPv4/IPv6 or source CIDR
rate_limit_rpm60-second sliding window per key
Daily/weekly/monthly capsStops new reservations at the limit
allow_web_searchEnables :online models; off by default
minimum_privacyPrevents downgrading Standard/Anonymous/Private
guardrails_modeOff, flag or block for injection; PII redaction by configuration

Store one key per secret. To rotate: create the replacement, deploy, verify, revoke the old key and confirm no later calls.

2. Understand spend controls​

Each team has one wallet. The financial flow:

  1. Validate key, permissions, balance and caps.
  2. Reserve the maximum estimated cost before upstream.
  3. Run the model.
  4. Settle once at the applicable cost and release the difference.
  5. Record request, daily usage and ledger movement.

Caps include settled spend plus open reservations, so concurrent requests cannot reserve the same funds twice.

  • Insufficient balance/expiry: 402 insufficient_credits.
  • Cap reached: 429 spend_cap_reached.
  • The monthly team cap is shared by all keys.
  • Automatic purchasing is off by default.

Wallet alerts fire at 50/75/90%. Configure the administrative email and a webhook if your operations need an actionable alert.

3. Configure guardrails​

The gateway can detect common prompt-injection patterns and redact identifiers such as Mexican CURP, RFC, CLABE, cards, email and phone numbers before upstream.

  • off: no global key guardrail; the request body can explicitly require PII redaction.
  • flag: allows the request and records signals in headers/metadata.
  • block: rejects detected injection before upstream; PII is redacted according to policy.

This reduces risk; it does not anonymize data or stop every attack. Keep input/output validation, permissions and human review in your application. Never send secrets just because redaction exists.

4. Operate usage and reconciliation​

Under Usage you can:

  • Select today, 7/30 days, previous month or a custom range.
  • Review key, model, day and requests.
  • Inspect input/output/cache tokens and search operations.
  • Download daily summaries or per-request CSV.
  • Investigate with request ID, status and latency.

Per-request CSV supports up to 10,000 rows and 90 days. Keep your application logs and request ID for financial reconciliation.

Usage by API key with demo data

5. Configure outgoing webhooks​

Under Integrations, create HTTPS endpoints for:

  • ai_gateway.cap_reached
  • ai_gateway.balance_low
  • ai_gateway.credits_exhausted

The whsec_... secret appears once. Verify X-Deployalo-Signature against the raw body and timestamp before processing. Make receivers idempotent and return quickly; move heavy work out of the HTTP request.

Each team can have up to five endpoints, with anti-SSRF protection. Test with ai_gateway.test before production.

6. Evaluate BYOK only where supported​

Bring Your Own Key lets a team register certain provider keys for Standard chat:

  • A compatible aggregator key can cover the supported catalog.
  • A direct OpenAI key only covers openai/* models.
  • It is encrypted with AES-256-GCM, validated live on registration and can be rotated/revoked.
  • The gateway charges a platform fee on list cost; check the current percentage in contract/dashboard.
  • Balance and caps still apply.
  • BYOK is not used for Anonymous/Private or as a guarantee for RAG/OCR/non-chat modalities.
  • A customer-key 401/403 does not silently fall back to the platform.

Customers see the provider they selected inside their own BYOK settings. Public responses remain white-label.

7. RAG knowledge​

Minimum flow:

  1. Create a collection and store its collection_id.
  2. Grant query, ingest or admin per key.
  3. Ingest supported text, Markdown, PDF or DOCX.
  4. Review sources, chunks and security_flags.
  5. Query and validate grounded answers.
  6. Export before migration or major deletion.
curl -X POST https://api.deployalo.com/ai/gateway/v1/collections \
-H "Authorization: Bearer $DEPLOYALO_AI_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"public-manuals","system_tone":"clear and concise"}'
curl -X POST https://api.deployalo.com/ai/gateway/v1/collections/ingest \
-H "Authorization: Bearer $DEPLOYALO_AI_KEY" \
-H "Content-Type: application/json" \
-d '{
"collection_id":"COLLECTION_ID",
"doc_name":"hours",
"content":"Support is open Monday through Friday, 9 AM to 6 PM."
}'
curl -X POST https://api.deployalo.com/ai/gateway/v1/collections/query \
-H "Authorization: Bearer $DEPLOYALO_AI_KEY" \
-H "Content-Type: application/json" \
-d '{"collection_id":"COLLECTION_ID","question":"What are the support hours?"}'

RAG stores content, vectors and originals depending on the source. Do not use a key with minimum privacy above Standard on this surface. Review the data guide.

8. OCR and comparison​

documents/extract accepts base64 image, MIME type and expected fields. documents/compare compares extracted values with captured values and normalizes supported formats.

  • Use synthetic documents first.
  • Limit resolution/size and output tokens.
  • Require human review before high-impact decisions.
  • OCR does not prove ID authenticity or replace clinical validation.
  • Vision detects rendered text; hidden PDF layers require specific analysis.

9. Retention and continuity​

Under Audit β†’ Privacy and retention, owners/admins can keep metadata until team deletion or purge requests/usage/audit after 1–3650 days. Purge runs every 15 minutes. Shortening the period can delete historical activity and requires confirmation.

Financial transactions and the ledger are not purged by age. Redis coordination backups are encrypted and tested with isolated restores; this does not make the service multi-host HA or replace your own exports.

Retention and audit with demo data

10. Production checklist​

Application​

  • The key lives in a backend secret manager.
  • Timeout, cancellation, jittered backoff and retry limits exist.
  • 400/401/402/403 are not retried automatically.
  • Request IDs are logged without prompts or secrets.
  • Streams close when user work is cancelled.
  • Model output is validated before triggering actions.

Access and cost​

  • One key per application/environment; no browser or shared CI keys.
  • Models, IP/CIDR and RPM follow least privilege.
  • Key and team caps were tested with conservative amounts.
  • Alerts, webhooks and balance owners are assigned.
  • CSV, wallet and ledger reconcile on a sample.

Data​

  • The responsible owner approved the data matrix.
  • Minimum privacy and per-surface restrictions are configured.
  • Retention, export and deletion were tested.
  • No sensitive data prohibited by the evaluation contract is present.
  • Legal/Procurement received the current DPA and subprocessors where applicable.

Operations​

  • Rotation and revocation procedures exist.
  • Upstream errors and application degradation were tested.
  • A quality metric and evaluation sample are defined.
  • Support knows the actual scope, contacts and signed contract.

Support: [email protected].