AppAIGatewayDocs
API referenceAdmin applications

Get the first request an application can send

GET
/v1/admin/apps/{app}/snippet

Written against what the application has today: a provider it can reach and a priced model where those exist, and named placeholders, explained in notes, where they do not. An App Attest application gets Swift for the App AI Gateway Swift package and a server application gets curl; asking for the other answers 400 unsupported_snippet. The URL is the one application clients call, which is this deployment's separate API host where it publishes one. A snippet never contains a credential: a server application's example reads its key from the APP_AI_GATEWAY_KEY environment variable.

Authorization

agw_identity_auth.session_token<token>

The console's session cookie. Admin requests from the console also send x-console-request: 1.

In: cookie

Path Parameters

app*string

Query Parameters

language?string

swift or curl. Defaults to swift for an App Attest application and curl for a server application; the other one is refused with 400 unsupported_snippet.

Value in

  • "swift"
  • "curl"
provider?string

The slug of the provider to write the example for. Defaults to the first one the application can reach. Unknown answers 404 provider_not_found; held but outside the application's routing or disabled answers 400 provider_unavailable.

Length1 <= length
endpoint?string

The name of one of the application's custom endpoints, to call it instead of a provider path. Unknown answers 404 endpoint_not_found.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/admin/apps/string/snippet"
{  "language": "swift",  "snippet": "string",  "notes": [    "string"  ]}