Skip to content
Discussion options

You must be logged in to vote

extra_query will append arbitrary query parameters to the HTTP request, but it does not make the server support filters that the endpoint does not define.

For client.batches.list(), the current API reference only documents after and limit as query parameters:
https://developers.openai.com/api/reference/resources/batches/methods/list/

So parameters like status or created_before are not server-side filters for this endpoint. You need to page through the batches and filter client-side, for example:

from datetime import datetime, timezone

cutoff = datetime.fromisoformat("2024-08-26T00:00:00+00:00")

for batch in client.batches.list(limit=100):
    created_at = datetime.fromtimestamp(batch.cr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Cybernetic-Ransomware
Comment options

Answer selected by Cybernetic-Ransomware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants