Invoking Applications with HTTP

Invoke an OCI Generative AI application with an HTTP client library or the curl command. The example uses identity domain bearer token authentication.

If the application uses No authentication, you don't need the platform bearer token shown in this example. Supply any credentials required by your application's own authentication. For other authentication options, see Invoking Applications.

In the following example:

  • The container image exposes an http endpoint POST /chat, therefore you concatenate /chat to the application URL.
  • The OAuth token is added to the Authorization header.
  • The body is in JSON which matches the payload format that you define in the container code.

Example code:

$ curl -X POST 
'https://inference.generativeai.ap-osaka-1.oci.oraclecloud.com
/20251112/hostedApplications/<your_application_ocid>/actions/invoke/chat' \
 

The previous example code is followed by this code:


  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access_token}' \
  --body '{
  "thread_id": "test-111",
  "message": "What's the weather in Seattle?"
}'