Anthid uses gRPC streaming to deliver live broker context back to your application as soon as it is available. REST is still the right interface for submissions and queries, but the stream is where your application receives immediate execution updates, order changes, position changes, heartbeats, and subscription confirmations. The protobuf definitions for Anthid streaming are published in the anthid-labs/proto repository.Documentation Index
Fetch the complete documentation index at: https://docs.anthid.com/llms.txt
Use this file to discover all available pages before exploring further.
Language Support
Any programming language with Protocol Buffers and gRPC support can connect to the Anthid streaming platform. Python is used in this guide because it is popular and easy to follow, but it is only an example. Teams can generate clients from the same proto definitions for languages such as Go, TypeScript, Java, C#, Rust, and others.Why gRPC
gRPC is a high-performance RPC framework built on HTTP/2 and Protocol Buffers. Instead of sending loosely shaped messages over a raw socket, gRPC gives you a typed service contract, generated clients, efficient binary payloads, and first-class streaming. Anthid chose gRPC over WebSockets for the streaming API because broker execution updates benefit from:- Strongly typed messages generated from shared
.protofiles - Efficient binary serialization with Protocol Buffers
- Bidirectional streaming over HTTP/2
- Built-in metadata for authentication, including
x-api-key - Cleaner client generation across languages
- A more structured contract for long-lived execution streams
Build the protobuf client
Clone the proto repository and generate Python client code from the.proto files.
macOS
If on a Mac, you can use Homebrew to install protobuf and Python dependencies then configure a local python virtual environment to support development such as the following.Install Dependencies
Setup Python Virtual Environment
Install dependencies into the virtual env
Clone Proto Dependencies
Change directory and Generate the Proto Client
Linux
On Linux and debian based systems, you can install protobuf and Python dependencies withapt-get and configure a local python virtual environment to support development such as the following.
Install Dependencies
Setup Python Virtual Environment
Install dependencies into the virtual env
Clone Proto Dependencies
Change directory and Generate the Proto Client
*_pb2.py and *_pb2_grpc.py files from your application.
Authentication
The initial gRPC connection must include your API key in thex-api-key metadata header.
Subscriptions
Once connected, your client can subscribe to additional message types for a trading account. By default, each organization can open up to100 streaming connections.
The subscription messages are defined in protobuf:
Subscribe message with the trading account ID and the event types your client wants to receive.
To unsubscribe, send an Unsubscribe message with the trading account ID.
Python example flow
The example below shows the expected flow. Update the generated import paths, request wrapper names, and stub method names to match the generated code from the proto repository.Unsubscribe flow
When your client no longer needs events for an account, send anUnsubscribe message on the same request stream.