Skip to content

softwaremill/sttp-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

532 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sttp-ai

Ideas, suggestions, problems, questions CI

sttp.ai:core sttp.ai:openai sttp.ai:claude

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.

Documentation

Full documentation is available at sttp-ai.softwaremill.com.

Quickstart

For OpenAI/OpenAI-compatible APIs

Add the following dependency:

"com.softwaremill.sttp.ai" %% "openai" % "0.5.2"

For Claude (Anthropic) API

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.

Contributing

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.

Commercial Support

We offer commercial support for sttp and related technologies, as well as development services. Contact us to learn more about our offer!

Copyright

Copyright (C) 2023-2025 SoftwareMill https://softwaremill.com.

About

Scala client for OpenAI, Claude, and compatible APIs

Topics

Resources

License

Stars

96 stars

Watchers

16 watching

Forks

Packages

 
 
 

Contributors

Languages

Generated from softwaremill/sbt-template