Keep keys off-device
The provider key is stored as a split-key envelope. The usable value exists only in gateway memory while a request is forwarded.
Use generated provider APIs or a generic HTTP client, preserve streaming and realtime behavior, and require Apple device proof before a request reaches the provider.
Obfuscation can slow extraction down, but it cannot make a provider key private. Move the credential boundary to a server and give the app only the narrowly scoped access it needs.
The provider key is stored as a split-key envelope. The usable value exists only in gateway memory while a request is forwarded.
Require DeviceCheck, an App Attest device token, or a Secure Enclave assertion that covers the method, URL, body and routing controls.
Restrict endpoints and models, rate-limit by app key, IP or device, and rotate named keys with a grace period for older releases.
HyperProxySwift exposes generated request and response types for supported providers while the gateway preserves each provider's path, body and streaming format.
import HyperProxyOpenAI
let openAI = HyperProxy.openAI(
gatewayURL: gatewayURL,
appKey: appKey
)
let response: OpenAIResponse =
try await openAI.responsesCreate(
OpenAICreateResponse(
input: "Hello", model: "gpt-5"
)
)Choose the trade-off per service. Attestation is enforced before HyperProxy opens the credential envelope or contacts the provider.
Attest once and exchange the result for a short-lived HyperProxy device token. It avoids an Apple round-trip on every AI request.
Sign a canonical request digest in Secure Enclave. Monotonic counters and one-time challenges defend against replay.
Use a fresh Apple proof for lightweight validation when the stronger App Attest integration is not required.
| Workload | Swift support | Gateway behavior |
|---|---|---|
| Chat and responses | Typed request and response models | Provider-native JSON |
| Streaming output | AsyncSequence for typed SSE or raw events | Streamed without response buffering |
| Audio, images and files | Multipart upload and binary progress | Incremental upload and download |
| Realtime | Typed JSON and binary WebSocket frames | Provider-native socket transport |
No distributed app can keep a long-lived credential secret. HyperProxy moves it behind the gateway and gives the app a service-scoped app key.
Yes. The transport includes typed SSE and JSONL, binary responses, uploads, polling and provider-native WebSockets.
No. Any HTTP client can call the gateway by preserving the provider path and body and replacing the upstream credential with X-HyperProxy-Key.