diff --git a/src/api/providers/__tests__/unbound.test.ts b/src/api/providers/__tests__/unbound.test.ts index 790c0f01296..e468555cc19 100644 --- a/src/api/providers/__tests__/unbound.test.ts +++ b/src/api/providers/__tests__/unbound.test.ts @@ -192,6 +192,11 @@ describe("UnboundHandler", () => { temperature: 0, max_tokens: 8192, }), + expect.objectContaining({ + headers: expect.objectContaining({ + "X-Unbound-Metadata": expect.stringContaining("roo-code"), + }), + }), ) }) @@ -233,6 +238,11 @@ describe("UnboundHandler", () => { messages: [{ role: "user", content: "Test prompt" }], temperature: 0, }), + expect.objectContaining({ + headers: expect.objectContaining({ + "X-Unbound-Metadata": expect.stringContaining("roo-code"), + }), + }), ) expect(mockCreate.mock.calls[0][0]).not.toHaveProperty("max_tokens") }) diff --git a/src/api/providers/unbound.ts b/src/api/providers/unbound.ts index e3894f87188..689bd454067 100644 --- a/src/api/providers/unbound.ts +++ b/src/api/providers/unbound.ts @@ -157,7 +157,18 @@ export class UnboundHandler extends BaseProvider implements SingleCompletionHand requestOptions.max_tokens = this.getModel().info.maxTokens } - const response = await this.client.chat.completions.create(requestOptions) + const response = await this.client.chat.completions.create(requestOptions, { + headers: { + "X-Unbound-Metadata": JSON.stringify({ + labels: [ + { + key: "app", + value: "roo-code", + }, + ], + }), + }, + }) return response.choices[0]?.message.content || "" } catch (error) { if (error instanceof Error) {