sttp is a family of Scala HTTP-related projects, and currently includes:
- sttp client: The Scala HTTP client you always wanted!
- sttp tapir: Typed API descRiptions
- sttp ai: this project. Non-official Scala client wrapper for OpenAI, Claude (Anthropic), and OpenAI-compatible APIs. Use the power of ChatGPT and Claude inside your code!
sttp-ai uses sttp client to describe requests and responses used in OpenAI, Claude (Anthropic), and OpenAI-compatible endpoints.
Full documentation is available at sttp-ai.softwaremill.com.
Add the following dependency:
"com.softwaremill.sttp.ai" %% "openai" % "0.5.2"Add the following dependency:
"com.softwaremill.sttp.ai" %% "claude" % "0.5.2"
// For streaming support, add one or more:
"com.softwaremill.sttp.ai" %% "claude-streaming-fs2" % "0.5.2" // cats-effect/fs2
"com.softwaremill.sttp.ai" %% "claude-streaming-zio" % "0.5.2" // ZIO
"com.softwaremill.sttp.ai" %% "claude-streaming-akka" % "0.5.2" // Akka Streams (Scala 2.13 only)
"com.softwaremill.sttp.ai" %% "claude-streaming-pekko" % "0.5.2" // Pekko Streams
"com.softwaremill.sttp.ai" %% "claude-streaming-ox" % "0.5.2" // Ox direct-style (Scala 3 only)sttp-openai is available for Scala 2.13 and Scala 3
Then head to the documentation for usage examples: OpenAI and Claude clients, streaming, structured outputs, tool calling, and the agent loop.
If you have a question, or hit a problem, feel free to post on our community https://softwaremill.community/c/open-source/
Or, if you encounter a bug, something is unclear in the code or documentation, don't hesitate and open an issue on GitHub.
For running integration tests against the real OpenAI API, see Integration Testing Guide.
We offer commercial support for sttp and related technologies, as well as development services. Contact us to learn more about our offer!
Copyright (C) 2023-2025 SoftwareMill https://softwaremill.com.
