Skip to main content

Services

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

ServiceWhat it does
ChatConversational AI - synchronous and streaming, tool calling, vision, reasoning, structured output
EmbeddingConvert text to dense vectors for semantic search, similarity, and RAG
RerankScore and sort a list of candidate passages against a query
Time SeriesForecast time series data using IBM Granite TTM models
DeploymentTarget a deployed model by deploymentId for chat and forecasting
Model GatewayChat with third-party models (OpenAI, Anthropic, etc.) via a unified IBM-managed gateway
Foundation ModelBrowse 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.

ServiceWhat it does
Create SchemaGenerate a key-value extraction schema from sample documents
Improve SchemaRefine an existing schema using additional examples
Merge SchemaConsolidate multiple schemas into one
Cluster SchemaGroup a set of schemas into semantically similar clusters
Text ExtractionExtract structured key-value pairs from documents in COS
Text ClassificationClassify documents stored in COS

Utilities

ServiceWhat it does
ToolInvoke IBM-hosted utility tools (search, weather, Python interpreter, RAG)
TokenizationCount tokens and retrieve the individual token strings for a given model
DetectionDetect harmful content (HAP), PII, and safety violations
FileUpload, list, retrieve, and delete files used as batch job inputs
BatchSubmit high-volume asynchronous inference jobs from JSONL files