Invoking Applications

This page lists different ways that you can invoke a OCI Generative AI application, after you create and deploy one.

Getting an Access Token

Because the underlying authentication type for an OCI Generative AI application is IAM with Identity Domains, to invoke an application using API calls, you must generate a bearer token and use it in the Authorization header. See Access Token.

  1. Navigate to the detail page of the application to see which identity domain is associated for this application. If you need help listing the applications, see Listing Applications.
  2. Navigate to the detail page of the identity domain specified for the application. If you need help listing the identity domains, see Listing Identity Domains.
  3. Gather the following information for the identity domain. If you need help see Using an OAuth Token for Platform Services
    • IDCS_CLIENT_ID
    • IDCS_CLIENT_SECRET
    • IDCS_SCOPE
    • IDCS_DOMAIN_URL
  4. Here is an example script to create an access token.
    export IDCS_DOMAIN_URL="https://idcs-xxx.identity.oraclecloud.com:443"
    export IDCS_CLIENT_ID="<client-id>"
    export IDCS_CLIENT_SECRET="******************"
    export IDCS_SCOPE="https://example_application.com/read"
    curl -s -X POST "${IDCS_DOMAIN_URL}/oauth2/v1/token" 
    -H "Content-Type: application/x-www-form-urlencoded" 
    -d "grant_type=client_credentials" -d "client_id=${IDCS_CLIENT_ID}" 
    -d "client_secret=${IDCS_CLIENT_SECRET}" -d "scope=${IDCS_SCOPE}" | jq .access_token