Every service in the SDK follows the same builder pattern: configure it once with credentials, endpoint, and (where applicable) a model ID, then call its methods to interact with the API. Service instances are thread-safe and intended to be shared, so create one per service per application, not one per request.
Inference
| Service | What it does |
|---|
| Chat | Conversational AI - synchronous and streaming, tool calling, vision, reasoning, structured output |
| Embedding | Convert text to dense vectors for semantic search, similarity, and RAG |
| Rerank | Score and sort a list of candidate passages against a query |
| Time Series | Forecast time series data using IBM Granite TTM models |
| Deployment | Target a deployed model by deploymentId for chat and forecasting |
| Model Gateway | Chat with third-party models (OpenAI, Anthropic, etc.) via a unified IBM-managed gateway |
| Foundation Model | Browse the model catalog - filter by provider, task, function, lifecycle |
Document processing
These services read from and write to IBM Cloud Object Storage (COS). A CONNECTION_ID and BUCKET_NAME are required in addition to the standard credentials. See Setup & Prerequisites.
Utilities
| Service | What it does |
|---|
| Tool | Invoke IBM-hosted utility tools (search, weather, Python interpreter, RAG) |
| Tokenization | Count tokens and retrieve the individual token strings for a given model |
| Detection | Detect harmful content (HAP), PII, and safety violations |
| File | Upload, list, retrieve, and delete files used as batch job inputs |
| Batch | Submit high-volume asynchronous inference jobs from JSONL files |