AI Frameworks & MCP
Vanix AI drops cleanly into modern agent frameworks and workflow orchestrators by overriding only the base URL and API key.
Vercel AI SDK
ts
import { createOpenAI } from '@ai-sdk/openai'
import { streamText } from 'ai'
const vanix = createOpenAI({
apiKey: process.env.VANIX_API_KEY,
baseURL: 'https://api.vanix.io/v1',
})
const result = streamText({
model: vanix('gpt-4o'),
prompt: 'Summarize our Q4 infrastructure SLA targets.',
})LangChain (Python)
python
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="gpt-4o",
api_key=os.environ["VANIX_API_KEY"],
base_url="https://api.vanix.io/v1",
temperature=0.2,
)
print(llm.invoke("Explain circuit breakers in one paragraph.").content)Dify & n8n Workflows
- Dify: Go to Settings → Model Provider → OpenAI-API-compatible, enter
https://api.vanix.io/v1, paste yoursk-...key, and add each model ID. - n8n: Open Credentials → OpenAI, paste your Vanix AI API key, and set Base URL to
https://api.vanix.io/v1.
MCP Access & Security Best Practices
When connecting AI agents to Model Context Protocol (MCP) servers while calling LLMs via Vanix AI:
- Isolate credentials: Never pass your Vanix AI key into untrusted third-party MCP server environments.
- Scope model tokens: Give MCP-enabled agents a dedicated Vanix AI key with a strict Quota Ceiling and Model Allowlist so prompt-injection loops cannot run unbounded spend.
- Require human approval for destructive MCP tool calls (database writes, shell execution, cloud infrastructure mutations).