Sending Requests to AI Gateway

After successfully creating an AI Gateway, you can start sending requests to the configured AI model by following these steps:

Step 1: Access the AI Gateway Portalarrow-up-right and locate the gateway you just created.

Step 2: In the Providers & Model section, find the AI model you configured. Click the Curl command icon to get a sample request.

Step 3: Copy the displayed curl command and execute it on your local machine (via Terminal or Command Prompt).

Example:

Note:

  • Replace {AUTHENTICATION_TOKEN} with the token provided after creating the Gateway

  • You can modify the prompt content (the question in the "content" field) to suit your use case.

  • If your AI Gateway is using Authenticated Gateway mode, you must include a header named cf-aig-authorization in your HTTP request.

For example, instead of using:

You must use:

After sending the request, you will receive a response from the AI model in JSON format.

Last updated