Skip to main content
Send a Chat Completions request through the NEAR AI Cloud Gateway and print the answer after the SDK verifies that the model service signed it.

Before you start

Set your API key in the environment:

Send a request and verify the reply

Understand the result

The SDK checks the receipt against the exact request and response bytes. The signature kind tells you who signed it. If the example stops because it requires a model-signed response, check that you selected a Confidential TEE Chat Completions model.

Adapt the flow

  • Client lifetime: verify the response with the client that sent the request, before its cached record expires (60 minutes by default).
  • Streaming: consume the entire stream before calling response verification.
  • Other APIs: use the response ID appropriate to the API. The SDK overview lists the IDs for Chat Completions, Responses, Messages, and System One.
  • Browser applications: use the browser SDK entry point. See TLS connection binding for runtime support, or inspect evidence with the Verification Center.
  • Software acceptance rules: follow verification policy and image provenance.