diff --git a/README.md b/README.md index b1f649c..83e5f1f 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ auto token = client.tokens().create(opts); decart::ClientOptions options; options.apiKey = "sk-..."; // or set DECART_API_KEY options.baseUrl = "https://api.decart.ai"; // HTTP API (tokens) -options.realtimeBaseUrl = "wss://api3.decart.ai"; // signaling +options.realtimeBaseUrl = "wss://api.decart.ai"; // signaling options.integration = "my-app"; // included in the User-Agent decart::Client client(options); ``` diff --git a/include/decart/client.h b/include/decart/client.h index 8479eee..0cd35e7 100644 --- a/include/decart/client.h +++ b/include/decart/client.h @@ -18,7 +18,7 @@ struct ClientOptions { std::string apiKey; /// Override the HTTP API base URL (default "https://api.decart.ai"). std::string baseUrl; - /// Override the realtime signaling base URL (default "wss://api3.decart.ai"). + /// Override the realtime signaling base URL (default "wss://api.decart.ai"). std::string realtimeBaseUrl; /// Optional integration identifier, included in the User-Agent. std::string integration; diff --git a/src/client.cpp b/src/client.cpp index 0d794ce..6b2ca65 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -50,7 +50,7 @@ Client::Client(ClientOptions options) : impl_(std::make_unique()) { } std::string realtimeBaseUrl = - options.realtimeBaseUrl.empty() ? "wss://api3.decart.ai" : options.realtimeBaseUrl; + options.realtimeBaseUrl.empty() ? "wss://api.decart.ai" : options.realtimeBaseUrl; if (!startsWith(realtimeBaseUrl, "ws://") && !startsWith(realtimeBaseUrl, "wss://")) { throw Exception(Error{ErrorCode::InvalidBaseUrl, "Invalid realtime base URL (must be ws:// or wss://): " + realtimeBaseUrl}); diff --git a/src/detail/client_config.h b/src/detail/client_config.h index 68c33f2..22633c9 100644 --- a/src/detail/client_config.h +++ b/src/detail/client_config.h @@ -10,7 +10,7 @@ namespace decart::detail { struct ClientConfig { std::string apiKey; std::string baseUrl; // e.g. "https://api.decart.ai" - std::string realtimeBaseUrl; // e.g. "wss://api3.decart.ai" + std::string realtimeBaseUrl; // e.g. "wss://api.decart.ai" std::string integration; }; diff --git a/src/detail/signaling_channel.h b/src/detail/signaling_channel.h index f7ce8de..c5a6b04 100644 --- a/src/detail/signaling_channel.h +++ b/src/detail/signaling_channel.h @@ -27,7 +27,7 @@ struct RoomInfo { std::string sessionId; }; -/// The Decart realtime signaling channel: a WebSocket to `wss://api3.decart.ai` +/// The Decart realtime signaling channel: a WebSocket to `wss://api.decart.ai` /// that performs the join handshake, carries prompt/image control messages /// (request/ack), and forwards server events. Media flows separately over /// LiveKit. See [[decart-realtime-wire-protocol]]. diff --git a/tests/test_stream_url.cpp b/tests/test_stream_url.cpp index b017ef8..daf7b33 100644 --- a/tests/test_stream_url.cpp +++ b/tests/test_stream_url.cpp @@ -13,7 +13,7 @@ using namespace decart::detail; namespace { -const std::string kBase = "wss://api3.decart.ai"; +const std::string kBase = "wss://api.decart.ai"; const std::string kKey = "sk-test"; std::size_t count(const std::string& haystack, const std::string& needle) { @@ -39,7 +39,7 @@ struct LogCapture { TEST_CASE("buildStreamUrl without options is unchanged and carries no speed param") { const auto model = models::realtime("lucy-2.5"); const auto url = buildStreamUrl(kBase, model, kKey, std::nullopt, std::nullopt); - CHECK(url == "wss://api3.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5"); + CHECK(url == "wss://api.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5"); CHECK(url.find("speed") == std::string::npos); CHECK(url.find("resolution") == std::string::npos); } @@ -47,7 +47,7 @@ TEST_CASE("buildStreamUrl without options is unchanged and carries no speed para TEST_CASE("buildStreamUrl appends resolution after model") { const auto model = models::realtime("lucy-2.5"); const auto url = buildStreamUrl(kBase, model, kKey, std::string("1080p"), std::nullopt); - CHECK(url == "wss://api3.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5&resolution=1080p"); + CHECK(url == "wss://api.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5&resolution=1080p"); } TEST_CASE("buildStreamUrl appends speed=fast exactly once, after resolution") { @@ -55,20 +55,20 @@ TEST_CASE("buildStreamUrl appends speed=fast exactly once, after resolution") { SUBCASE("speed only") { const auto url = buildStreamUrl(kBase, model, kKey, std::nullopt, Speed::Fast); - CHECK(url == "wss://api3.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5&speed=fast"); + CHECK(url == "wss://api.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5&speed=fast"); CHECK(count(url, "speed=") == 1); } SUBCASE("speed with resolution") { const auto url = buildStreamUrl(kBase, model, kKey, std::string("720p"), Speed::Fast); - CHECK(url == "wss://api3.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5&resolution=720p&speed=fast"); + CHECK(url == "wss://api.decart.ai/v1/stream?api_key=sk-test&model=lucy-2.5&resolution=720p&speed=fast"); CHECK(count(url, "speed=") == 1); } SUBCASE("still sent for models without the capability (server ignores it)") { const auto restyle = models::realtime("lucy-restyle-2"); const auto url = buildStreamUrl(kBase, restyle, kKey, std::nullopt, Speed::Fast); - CHECK(url == "wss://api3.decart.ai/v1/stream?api_key=sk-test&model=lucy-restyle-2&speed=fast"); + CHECK(url == "wss://api.decart.ai/v1/stream?api_key=sk-test&model=lucy-restyle-2&speed=fast"); } }