Repolode
cequence-io

cequence-io/openai-scala-client

Async Scala client for the OpenAI API and many other LLM providers, covering chat, responses, streaming, batches, and more.

Stars
257
Forks
40
Open issues
9
Last commit
8 hours ago

What is it?

This is a Scala client library for the OpenAI API that exposes nearly all of its endpoints through one service, OpenAIService, including chat completions, the Responses API, embeddings, images, audio, files, batches, vector stores and graders. It also provides adapters that let the same calls run against Anthropic (including Bedrock), Google Gemini and Vertex AI, Groq, Perplexity, Mistral, Cerebras and other OpenAI-compatible endpoints.

Streaming is supported through a provider-neutral typed stream of text, thinking, tool-call and tool-result chunks, and tool use includes MCP. The library is built with few dependencies, using its own generic WS client on top of Play WS, and uses scala-guice when dependency injection is needed. It targets Scala 2.12, 2.13 and 3.

The project also includes decision-model interfaces for typed answers with probabilities, and Anthropic-specific coverage for Messages, Message Batches, Skills and Managed Agents.

Key features

  • 01Single OpenAIService covering chat, Responses, embeddings, images, audio, files and batches
  • 02Adapters for Anthropic, Bedrock, Gemini, Vertex AI, Groq, Perplexity and other providers
  • 03Provider-neutral typed streaming with text, thinking and tool-call chunks
  • 04Tool calling including MCP support
  • 05Supports Scala 2.12, 2.13 and 3

Use cases

  • Calling OpenAI or compatible LLM endpoints from a Scala backend service
  • Switching between several LLM providers behind one client interface
  • Running large batch jobs for embeddings or chat requests
  • Building streaming chat or agent features in Scala applications

Things to know

  • Several endpoints are deprecated or shut down, including the Assistants, Threads, Runs and Run Steps APIs, the Edits endpoint, and createImageVariation.
  • Some provider integrations are retired or obsolete, such as Perplexity's Sonar chat completions and Octo AI.

In collections

Topics

FAQ

What is openai-scala-client?
Async Scala client for the OpenAI API and many other LLM providers, covering chat, responses, streaming, batches, and more. This is a Scala client library for the OpenAI API that exposes nearly all of its endpoints through one service, OpenAIService, including chat completions, the Responses API, embeddings, images, audio, files, batches, vector stores and graders. It also provides adapters that let the same calls run against Anthropic (including Bedrock), Google Gemini and Vertex AI, Groq, Perplexity, Mistral, Cerebras and other OpenAI-compatible endpoints.
Is openai-scala-client free to use? What license does it have?
openai-scala-client is open source under the MIT license. Check the license terms before using it in commercial products.
Is openai-scala-client still maintained?
Actively maintained. The last commit to openai-scala-client was on Nov 6, 2026.
What can I use openai-scala-client for?
Calling OpenAI or compatible LLM endpoints from a Scala backend service Switching between several LLM providers behind one client interface Running large batch jobs for embeddings or chat requests Building streaming chat or agent features in Scala applications
Where can I get openai-scala-client?
The source code and installation instructions are on GitHub: https://github.com/cequence-io/openai-scala-client

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects

A Thunderbird add-on that brings ChatGPT, Gemini, Claude or Ollama into your mailbox to reply, proofread, translate, summarize and tag emails.

Productivity & Apps#thunderbird#email#thunderbird-addon
367+4 this week66JavaScriptGPL-3.0Well maintainedUpdated 4 hours ago