Skip to content

Commit 3c638db

Browse files
authored
Merge pull request #106 from Portkey-AI/chore/batch-output
chore: add batch output api
2 parents f970d62 + 89be5fb commit 3c638db

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

openapi.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9486,6 +9486,117 @@ paths:
94869486

94879487
main();
94889488

9489+
/batches/{batch_id}/output:
9490+
servers: *DataPlaneServers
9491+
get:
9492+
operationId: getBatchOutput
9493+
tags:
9494+
- Batch
9495+
summary: Returns batch output as stream.
9496+
parameters:
9497+
- in: path
9498+
name: batch_id
9499+
required: true
9500+
schema:
9501+
type: string
9502+
description: The ID of the batch to retrieve output for.
9503+
responses:
9504+
"200":
9505+
description: Batch output returned successfully.
9506+
content:
9507+
application/octet-stream:
9508+
schema:
9509+
type: string
9510+
format: binary
9511+
9512+
9513+
security:
9514+
- Portkey-Key: []
9515+
Virtual-Key: []
9516+
- Portkey-Key: []
9517+
Provider-Auth: []
9518+
Provider-Name: []
9519+
- Portkey-Key: []
9520+
Config: []
9521+
- Portkey-Key: []
9522+
Provider-Auth: []
9523+
Provider-Name: []
9524+
Custom-Host: []
9525+
9526+
x-code-samples:
9527+
- lang: curl
9528+
label: Default
9529+
source: |
9530+
curl https://api.portkey.ai/v1/batches/batch_abc123/output \
9531+
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
9532+
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
9533+
-H "Content-Type: application/json" \
9534+
- lang: python
9535+
label: Default
9536+
source: |
9537+
from portkey_ai import Portkey
9538+
9539+
client = Portkey(
9540+
api_key = "PORTKEY_API_KEY",
9541+
virtual_key = "PROVIDER_VIRTUAL_KEY"
9542+
)
9543+
9544+
client.batches.output("batch_abc123")
9545+
- lang: javascript
9546+
label: Default
9547+
source: |
9548+
import Portkey from 'portkey-ai';
9549+
9550+
const client = new Portkey({
9551+
apiKey: 'PORTKEY_API_KEY',
9552+
virtualKey: 'PROVIDER_VIRTUAL_KEY'
9553+
});
9554+
9555+
async function main() {
9556+
const batch = await client.batches.output("batch_abc123");
9557+
9558+
console.log(batch);
9559+
}
9560+
9561+
main();
9562+
- lang: curl
9563+
label: Self-Hosted
9564+
source: |
9565+
curl SELF_HOSTED_GATEWAY_URL/batches/batch_abc123/output \
9566+
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
9567+
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
9568+
-H "Content-Type: application/json" \
9569+
- lang: python
9570+
label: Self-Hosted
9571+
source: |
9572+
from portkey_ai import Portkey
9573+
9574+
client = Portkey(
9575+
api_key = "PORTKEY_API_KEY",
9576+
base_url = "SELF_HOSTED_GATEWAY_URL",
9577+
virtual_key = "PROVIDER_VIRTUAL_KEY"
9578+
)
9579+
9580+
client.batches.output("batch_abc123")
9581+
- lang: javascript
9582+
label: Self-Hosted
9583+
source: |
9584+
import Portkey from 'portkey-ai';
9585+
9586+
const client = new Portkey({
9587+
apiKey: 'PORTKEY_API_KEY',
9588+
baseUrl: 'SELF_HOSTED_GATEWAY_URL',
9589+
virtualKey: 'PROVIDER_VIRTUAL_KEY'
9590+
});
9591+
9592+
async function main() {
9593+
const batch = await client.batches.output("batch_abc123");
9594+
9595+
console.log(batch);
9596+
}
9597+
9598+
main();
9599+
94899600
/batches/{batch_id}:
94909601
servers: *DataPlaneServers
94919602
get:

0 commit comments

Comments
 (0)