Skip to content

Commit 01c55d8

Browse files
feat: Surface platform credits in the public API
1 parent c227ff5 commit 01c55d8

5 files changed

Lines changed: 36 additions & 4 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-933dc0de5653397e66fc2618c9aeb6dc1b65bc327fe36346bb59f0bd0c25b2bd.yml
3-
openapi_spec_hash: fed1d156b2b419f2bee85db21d5870f5
4-
config_hash: ea21d91999803fd188cdbfdf2c654914
1+
configured_endpoints: 23
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-439930897f625c088be1b09e394f4053e45060cd2daab7454dfcf6c775cba1fb.yml
3+
openapi_spec_hash: f0382bea9210d76f906665e8a825a05b
4+
config_hash: 5a6e285f6e3a958a887b31b972a3f49c

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Methods:
7979
- <code title="put /agent/identities/{uid}">client.agent.agent.<a href="./src/resources/agent/agent_.ts">update</a>(uid, { ...params }) -> AgentResponse</code>
8080
- <code title="get /agent/identities">client.agent.agent.<a href="./src/resources/agent/agent_.ts">list</a>() -> ListAgentIdentitiesResponse</code>
8181
- <code title="delete /agent/identities/{uid}">client.agent.agent.<a href="./src/resources/agent/agent_.ts">delete</a>(uid) -> void</code>
82+
- <code title="get /agent/identities/{uid}">client.agent.agent.<a href="./src/resources/agent/agent_.ts">get</a>(uid) -> AgentResponse</code>
8283

8384
## Sessions
8485

src/resources/agent/agent_.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ export class Agent extends APIResource {
6767
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
6868
});
6969
}
70+
71+
/**
72+
* Retrieve a single agent by its unique identifier. The response includes an
73+
* `available` flag indicating whether the agent is within the team's plan limit
74+
* and may be used for runs.
75+
*
76+
* @example
77+
* ```ts
78+
* const agentResponse = await client.agent.agent.get('uid');
79+
* ```
80+
*/
81+
get(uid: string, options?: RequestOptions): APIPromise<AgentResponse> {
82+
return this._client.get(path`/agent/identities/${uid}`, options);
83+
}
7084
}
7185

7286
export interface AgentResponse {

src/resources/agent/runs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ export namespace RunItem {
455455
* Cost of LLM inference for the run
456456
*/
457457
inference_cost?: number;
458+
459+
/**
460+
* Cost of platform usage for the run
461+
*/
462+
platform_cost?: number;
458463
}
459464

460465
/**

tests/api-resources/agent/agent_.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,16 @@ describe('resource agent', () => {
6565
expect(dataAndResponse.data).toBe(response);
6666
expect(dataAndResponse.response).toBe(rawResponse);
6767
});
68+
69+
// Mock server tests are disabled
70+
test.skip('get', async () => {
71+
const responsePromise = client.agent.agent.get('uid');
72+
const rawResponse = await responsePromise.asResponse();
73+
expect(rawResponse).toBeInstanceOf(Response);
74+
const response = await responsePromise;
75+
expect(response).not.toBeInstanceOf(Response);
76+
const dataAndResponse = await responsePromise.withResponse();
77+
expect(dataAndResponse.data).toBe(response);
78+
expect(dataAndResponse.response).toBe(rawResponse);
79+
});
6880
});

0 commit comments

Comments
 (0)