Complete guides, API reference, SDK documentation, architecture diagrams, and direct support — all in one place.
# Any OpenAI SDK client — zero code changes required from openai import OpenAI client = OpenAI( base_url="https://YOUR_SMARTFLOW_HOST/v1", api_key="sk-sf-your-virtual-key" # issued by your Smartflow admin ) response = client.chat.completions.create( model="gpt-4o", # or "claude-sonnet-4-6", "gemini-2.0-flash", any routed model messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
# Native Anthropic SDK — point base_url at Smartflow, nothing else changes import os from anthropic import Anthropic # Or set env: ANTHROPIC_BASE_URL=https://YOUR_SMARTFLOW_HOST/anthropic client = Anthropic( base_url="https://YOUR_SMARTFLOW_HOST/anthropic", api_key="sk-sf-your-virtual-key" ) message = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, messages=[{"role": "user", "content": "Hello!"}] ) print(message.content[0].text)
# OpenAI-compatible endpoint (all models) curl https://YOUR_SMARTFLOW_HOST/v1/chat/completions \ -H "Authorization: Bearer sk-sf-your-virtual-key" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "messages": [{"role": "user", "content": "Hello!"}] }' # Native Anthropic Messages API curl https://YOUR_SMARTFLOW_HOST/anthropic/v1/messages \ -H "x-api-key: sk-sf-your-virtual-key" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello!"}] }'
# Async streaming with the standard OpenAI AsyncClient import asyncio from openai import AsyncOpenAI client = AsyncOpenAI( base_url="https://YOUR_SMARTFLOW_HOST/v1", api_key="sk-sf-your-virtual-key" ) async def main(): # Streaming chat completion stream = await client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Explain quantum entanglement"}], stream=True ) async for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) asyncio.run(main())
# Contact your Smartflow account team for the Helm chart and values file. # Example values — replace placeholders with your actual configuration: # values.yaml secrets: openaiApiKey: "sk-..." # your OpenAI key anthropicApiKey: "sk-ant-..." # your Anthropic key googleApiKey: "AIza..." # optional: Google Gemini ingress: host: "smartflow.your-domain.com" tls: true # Deploy helm upgrade --install smartflow ./smartflow-chart \ --namespace smartflow --create-namespace \ -f values.yaml # Verify all pods are running kubectl get pods -n smartflow kubectl rollout status deployment/smartflow-proxy -n smartflow
#!/usr/bin/env bash # Smartflow Integration Test Script # Fill in your deployment details, then run: bash smartflow_test.sh export SMARTFLOW_HOST="https://your-smartflow.example.com" # no trailing slash export VIRTUAL_KEY="sk-sf-your-virtual-key" echo "=== Test 1: Health Check ===" curl -sf "$SMARTFLOW_HOST/health" | python3 -m json.tool echo "=== Test 2: OpenAI-compatible chat ===" curl -s "$SMARTFLOW_HOST/v1/chat/completions" \ -H "Authorization: Bearer $VIRTUAL_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Reply with one word: PASS"}]}' \ | python3 -m json.tool echo "=== Test 3: Anthropic native messages ===" curl -s "$SMARTFLOW_HOST/anthropic/v1/messages" \ -H "x-api-key: $VIRTUAL_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{"model":"claude-sonnet-4-6","max_tokens":32,"messages":[{"role":"user","content":"Reply: PASS"}]}' \ | python3 -m json.tool echo "=== Test 4: Available models ===" curl -s -H "Authorization: Bearer $VIRTUAL_KEY" \ "$SMARTFLOW_HOST/v1/models" | python3 -m json.tool echo "=== Test 5: Cache stats ===" curl -s -H "Authorization: Bearer $VIRTUAL_KEY" \ "$SMARTFLOW_HOST/api/metacache/stats" | python3 -m json.tool
A virtual key (sk-sf-...) is the only credential your application needs.
Your Smartflow admin issues it — no provider keys ever leave the server.
POST /api/auth/virtual-keys if you have admin access.
SmartflowClient and SyncSmartflowClient — chat, completions, Anthropic native, compliance, cache, VAS logs, MCP, A2A, and more.claude-sonnet-4-6.