Install
Requires Go 1.26.10 or later. Install the published SDK in your application:Examples
Choose the tab matching your model’s API. Save the example asmain.go and run it with go run ..
- Chat Completions
- Responses
- Messages
- System One
Call a supported NEAR TEE model with E2EE enabled, then verify the completion.
E2EE
Gateway E2EE is disabled by default. SetE2EE: true to encrypt supported Chat fields to an attested model key and decrypt the response automatically.
E2EE requires a NEAR vLLM model with attestation enabled. Other providers use Gateway-only verification; leave E2EE disabled for those models.
Verification
Before sending Chat, the client verifies the Gateway and every returned model report for supported models. Attested Gateway TLS pinning is enabled by default; normal HTTPS certificate validation remains enabled. Failed required checks stop the request. Response-signature verification is explicit: callclient.VerifyResponse(ctx, completionID) after fully consuming the response. The client retains exact request and response bytes automatically, including encrypted wire bytes when E2EE is enabled.
See Verification for receipt IDs and signature kinds.
Response records expire 60 minutes after the full response is read, by default. Verify each response before its record expires or the client closes.
To check a deployment without sending a prompt, call client.Verify(ctx, model). For custom policies and cache settings, see the Go verification guide.
OHTTP
SetOHTTP: true in InferenceOptions to encapsulate the Chat HTTP exchange to the attested Gateway. OHTTP is disabled by default and requires Ed25519, the default signing algorithm. Configure E2EE independently. Missing or invalid Gateway OHTTP evidence blocks Chat.
OHTTP supports Chat Completions, Responses, and Messages through the Gateway; System One does not support OHTTP. Attestation and signature requests remain regular HTTPS. The endpoint must expose
/ohttp at the same origin. Outer authorization headers and the client’s network address are not hidden by OHTTP.Examples and reference
- Go verification guide: policies, encryption, streaming, TLS binding, and errors.
- Go API reference: client options, verification functions, defaults, and result fields.
- Runnable Go examples: Gateway and direct clients, standalone verification, and streaming.
- OpenAI SDK integration: Chat Completions and Responses.
- Anthropic SDK integration.