Search K
Appearance
Appearance
Replace the placeholder values in the following Python snippet with your actual credentials and parameters, then run the script to integrate with F5 AI Security.
from anthropic import Anthropic
BASE_URL = "{BASE_URL}/openai/{CONNECTION_NAME}"
CAI_TOKEN = "{CAI_TOKEN}"
client = Anthropic(base_url=BASE_URL, api_key=CAI_TOKEN)
message = client.messages.create(
max_tokens=1024,
messages=[
{
"content": "What is the capital of France?",
"role": "user",
},
],
model="claude-haiku-4-5",
)
print(message.content[0].text)You can integrate F5 AI Security. We provide a code snippet to help with the process, which requires the following variables:
BASE_URL: The URL of the AI Security deployment. Depends on whether your deployment uses AI Security SaaS or your own on-premises system.
CAI_TOKEN: See Get Your Authorization Token for instructions on how to obtain an API key.
CONNECTION_NAME: Name of the configured Anthropic connection that the SDK should use.