Skip to content

Integrate with OpenAI models

You can integrate F5 AI Security. We provide a Python script to help with the process, which includes 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.
  • API_KEY: You can get your API_KEY, also known as an authorization token.
  • PROVIDER_API_KEY: Provided by OpenAI. Consult their documentation for instructions.

Substitute actual values in the following Python script, and run it:

python
from calypsoai import CalypsoAI

cai = CalypsoAI(url={BASE_URL}, token={API_KEY})

provider = cai.providers.create(
    "Example-openai-gpt-4",
    "openai-chat",
    secrets={
        "apiKey": {"name": "OpenAI API Key", "value": "{PROVIDER_API_KEY}"},
    },
    maxRequestsPerSecond=5,
)

Updated at: