Java SDK
Java SDK
A highly-performant, typed Java SDK for integrating MeshAPI into your Spring or Java 17+ applications.
Requirements
- Java 17 or higher
- Maven 3.6 or higher
Installation
Add MeshAPI as a dependency in your pom.xml:
Quick Start
Initialize the builder pattern provided by the MeshAPI class.
Standard Chat Completion
Streaming Chat Completion
Streaming returns a structured Iterator.
Error Handling
Like other MeshAPI SDKs, retries on transient errors are handled for you automatically (up to 3 retries with a maximum 30s timeout and variable jitter, supporting Retry-After).
You can configure error limits manually:
If an error is fatal or limits are breached, MeshAPIError is thrown:
[!WARNING] Streams do not automatically retry! Ensure your
while(it.hasNext())loop capturesMeshAPIErrors representing drops, such as thestream_interruptederror code.