Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
run: |
bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.WARP_API_NPM_TOKEN || secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.OZ_API_NPM_TOKEN || secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.WARP_API_NPM_TOKEN || secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.OZ_API_NPM_TOKEN || secrets.NPM_TOKEN }}

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.0.0-alpha.7"
".": "1.0.0-alpha.8"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 12
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-c99d72d8d845f1eeabf7a716949a12408df952a2a0ca2b97df570da3a7c8bb49.yml
openapi_spec_hash: 8a503cbccc8a5741554282327a557114
config_hash: 38a89a860ee0f5ef4f2cb10d010e4e8f
config_hash: 433e7a5579323a048aa173a0ace06bfc
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.0-alpha.8 (2026-02-08)

Full Changelog: [v1.0.0-alpha.7...v1.0.0-alpha.8](https://github.com/warpdotdev/oz-sdk-typescript/compare/v1.0.0-alpha.7...v1.0.0-alpha.8)

### Features

* **api:** manual updates ([51bba74](https://github.com/warpdotdev/oz-sdk-typescript/commit/51bba74cf406ac231d328f5d084788a9902e478f))

## 1.0.0-alpha.7 (2026-02-08)

Full Changelog: [v1.0.0-alpha.6...v1.0.0-alpha.7](https://github.com/warpdotdev/oz-sdk-typescript/compare/v1.0.0-alpha.6...v1.0.0-alpha.7)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2026 Warp API
Copyright 2026 Oz API

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Warp API TypeScript API Library
# Oz API TypeScript API Library

[![NPM version](<https://img.shields.io/npm/v/oz-agent-sdk.svg?label=npm%20(stable)>)](https://npmjs.org/package/oz-agent-sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/oz-agent-sdk)

This library provides convenient access to the Warp API REST API from server-side TypeScript or JavaScript.
This library provides convenient access to the Oz API REST API from server-side TypeScript or JavaScript.

The full API of this library can be found in [api.md](api.md).

Expand All @@ -20,9 +20,9 @@ The full API of this library can be found in [api.md](api.md).

<!-- prettier-ignore -->
```js
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';

const client = new WarpAPI({
const client = new OzAPI({
apiKey: process.env['WARP_API_KEY'], // This is the default and can be omitted
});

Expand Down Expand Up @@ -98,14 +98,14 @@ This library includes TypeScript definitions for all request params and response

<!-- prettier-ignore -->
```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';

const client = new WarpAPI({
const client = new OzAPI({
apiKey: process.env['WARP_API_KEY'], // This is the default and can be omitted
});

const params: WarpAPI.AgentRunParams = { prompt: 'Fix the bug in auth.go' };
const response: WarpAPI.AgentRunResponse = await client.agent.run(params);
const params: OzAPI.AgentRunParams = { prompt: 'Fix the bug in auth.go' };
const response: OzAPI.AgentRunResponse = await client.agent.run(params);
```

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
Expand All @@ -119,7 +119,7 @@ a subclass of `APIError` will be thrown:
<!-- prettier-ignore -->
```ts
const response = await client.agent.run({ prompt: 'Fix the bug in auth.go' }).catch(async (err) => {
if (err instanceof WarpAPI.APIError) {
if (err instanceof OzAPI.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
Expand Down Expand Up @@ -153,7 +153,7 @@ You can use the `maxRetries` option to configure or disable this:
<!-- prettier-ignore -->
```js
// Configure the default for all requests:
const client = new WarpAPI({
const client = new OzAPI({
maxRetries: 0, // default is 2
});

Expand All @@ -170,7 +170,7 @@ Requests time out after 1 minute by default. You can configure this with a `time
<!-- prettier-ignore -->
```ts
// Configure the default for all requests:
const client = new WarpAPI({
const client = new OzAPI({
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
});

Expand All @@ -196,7 +196,7 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse

<!-- prettier-ignore -->
```ts
const client = new WarpAPI();
const client = new OzAPI();

const response = await client.agent.run({ prompt: 'Fix the bug in auth.go' }).asResponse();
console.log(response.headers.get('X-My-Header'));
Expand All @@ -219,13 +219,13 @@ console.log(response.run_id);

The log level can be configured in two ways:

1. Via the `WARP_API_LOG` environment variable
1. Via the `OZ_API_LOG` environment variable
2. Using the `logLevel` client option (overrides the environment variable if set)

```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';

const client = new WarpAPI({
const client = new OzAPI({
logLevel: 'debug', // Show all log messages
});
```
Expand All @@ -251,13 +251,13 @@ When providing a custom logger, the `logLevel` option still controls which messa
below the configured level will not be sent to your logger.

```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';
import pino from 'pino';

const logger = pino();

const client = new WarpAPI({
logger: logger.child({ name: 'WarpAPI' }),
const client = new OzAPI({
logger: logger.child({ name: 'OzAPI' }),
logLevel: 'debug', // Send all messages to pino, allowing it to filter
});
```
Expand Down Expand Up @@ -320,20 +320,20 @@ globalThis.fetch = fetch;
Or pass it to the client:

```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';
import fetch from 'my-fetch';

const client = new WarpAPI({ fetch });
const client = new OzAPI({ fetch });
```

### Fetch options

If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)

```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';

const client = new WarpAPI({
const client = new OzAPI({
fetchOptions: {
// `RequestInit` options
},
Expand All @@ -348,11 +348,11 @@ options to requests:
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>

```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';
import * as undici from 'undici';

const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
const client = new WarpAPI({
const client = new OzAPI({
fetchOptions: {
dispatcher: proxyAgent,
},
Expand All @@ -362,9 +362,9 @@ const client = new WarpAPI({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>

```ts
import WarpAPI from 'oz-agent-sdk';
import OzAPI from 'oz-agent-sdk';

const client = new WarpAPI({
const client = new OzAPI({
fetchOptions: {
proxy: 'http://localhost:8888',
},
Expand All @@ -374,10 +374,10 @@ const client = new WarpAPI({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>

```ts
import WarpAPI from 'npm:oz-agent-sdk';
import OzAPI from 'npm:oz-agent-sdk';

const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
const client = new WarpAPI({
const client = new OzAPI({
fetchOptions: {
client: httpClient,
},
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Warp API, please follow the respective company's security reporting guidelines.
or products provided by Oz API, please follow the respective company's security reporting guidelines.

---

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "oz-agent-sdk",
"version": "1.0.0-alpha.7",
"description": "The official TypeScript library for the Warp API API",
"author": "Warp API <>",
"version": "1.0.0-alpha.8",
"description": "The official TypeScript library for the Oz API API",
"author": "Oz API <>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
30 changes: 15 additions & 15 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface ClientOptions {
/**
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
*
* Defaults to process.env['WARP_API_BASE_URL'].
* Defaults to process.env['OZ_API_BASE_URL'].
*/
baseURL?: string | null | undefined;

Expand Down Expand Up @@ -106,7 +106,7 @@ export interface ClientOptions {
/**
* Set the log level.
*
* Defaults to process.env['WARP_API_LOG'] or 'warn' if it isn't set.
* Defaults to process.env['OZ_API_LOG'] or 'warn' if it isn't set.
*/
logLevel?: LogLevel | undefined;

Expand All @@ -119,9 +119,9 @@ export interface ClientOptions {
}

/**
* API Client for interfacing with the Warp API API.
* API Client for interfacing with the Oz API API.
*/
export class WarpAPI {
export class OzAPI {
apiKey: string;

baseURL: string;
Expand All @@ -137,10 +137,10 @@ export class WarpAPI {
private _options: ClientOptions;

/**
* API Client for interfacing with the Warp API API.
* API Client for interfacing with the Oz API API.
*
* @param {string | undefined} [opts.apiKey=process.env['WARP_API_KEY'] ?? undefined]
* @param {string} [opts.baseURL=process.env['WARP_API_BASE_URL'] ?? https://app.warp.dev/api/v1] - Override the default base URL for the API.
* @param {string} [opts.baseURL=process.env['OZ_API_BASE_URL'] ?? https://app.warp.dev/api/v1] - Override the default base URL for the API.
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
Expand All @@ -149,13 +149,13 @@ export class WarpAPI {
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
*/
constructor({
baseURL = readEnv('WARP_API_BASE_URL'),
baseURL = readEnv('OZ_API_BASE_URL'),
apiKey = readEnv('WARP_API_KEY'),
...opts
}: ClientOptions = {}) {
if (apiKey === undefined) {
throw new Errors.WarpAPIError(
"The WARP_API_KEY environment variable is missing or empty; either provide it, or instantiate the WarpAPI client with an apiKey option, like new WarpAPI({ apiKey: 'My API Key' }).",
throw new Errors.OzAPIError(
"The WARP_API_KEY environment variable is missing or empty; either provide it, or instantiate the OzAPI client with an apiKey option, like new OzAPI({ apiKey: 'My API Key' }).",
);
}

Expand All @@ -166,14 +166,14 @@ export class WarpAPI {
};

this.baseURL = options.baseURL!;
this.timeout = options.timeout ?? WarpAPI.DEFAULT_TIMEOUT /* 1 minute */;
this.timeout = options.timeout ?? OzAPI.DEFAULT_TIMEOUT /* 1 minute */;
this.logger = options.logger ?? console;
const defaultLogLevel = 'warn';
// Set default logLevel early so that we can log a warning in parseLogLevel.
this.logLevel = defaultLogLevel;
this.logLevel =
parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
parseLogLevel(readEnv('WARP_API_LOG'), "process.env['WARP_API_LOG']", this) ??
parseLogLevel(readEnv('OZ_API_LOG'), "process.env['OZ_API_LOG']", this) ??
defaultLogLevel;
this.fetchOptions = options.fetchOptions;
this.maxRetries = options.maxRetries ?? 2;
Expand Down Expand Up @@ -699,10 +699,10 @@ export class WarpAPI {
}
}

static WarpAPI = this;
static OzAPI = this;
static DEFAULT_TIMEOUT = 60000; // 1 minute

static WarpAPIError = Errors.WarpAPIError;
static OzAPIError = Errors.OzAPIError;
static APIError = Errors.APIError;
static APIConnectionError = Errors.APIConnectionError;
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
Expand All @@ -721,9 +721,9 @@ export class WarpAPI {
agent: API.Agent = new API.Agent(this);
}

WarpAPI.Agent = Agent;
OzAPI.Agent = Agent;

export declare namespace WarpAPI {
export declare namespace OzAPI {
export type RequestOptions = Opts.RequestOptions;

export {
Expand Down
8 changes: 4 additions & 4 deletions src/core/api-promise.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { type WarpAPI } from '../client';
import { type OzAPI } from '../client';

import { type PromiseOrValue } from '../internal/types';
import { APIResponseProps, defaultParseResponse } from '../internal/parse';
Expand All @@ -11,13 +11,13 @@ import { APIResponseProps, defaultParseResponse } from '../internal/parse';
*/
export class APIPromise<T> extends Promise<T> {
private parsedPromise: Promise<T> | undefined;
#client: WarpAPI;
#client: OzAPI;

constructor(
client: WarpAPI,
client: OzAPI,
private responsePromise: Promise<APIResponseProps>,
private parseResponse: (
client: WarpAPI,
client: OzAPI,
props: APIResponseProps,
) => PromiseOrValue<T> = defaultParseResponse,
) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import { castToError } from '../internal/errors';

export class WarpAPIError extends Error {}
export class OzAPIError extends Error {}

export class APIError<
TStatus extends number | undefined = number | undefined,
THeaders extends Headers | undefined = Headers | undefined,
TError extends Object | undefined = Object | undefined,
> extends WarpAPIError {
> extends OzAPIError {
/** HTTP status for the response that caused the error */
readonly status: TStatus;
/** HTTP headers for the response that caused the error */
Expand Down
Loading