# In which openai version is batch api and files api supported

**URL:** <https://community.openai.com/t/in-which-openai-version-is-batch-api-and-files-api-supported/844388>\
**Category:** API\
**Created:** [June 28, 2024, 9:25am UTC](https://community.openai.com/t/in-which-openai-version-is-batch-api-and-files-api-supported/844388 "2024-06-28T09:25:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsgreen274](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/dsgreen274/32/148754_2.png) [@dsgreen274](https://community.openai.com/u/dsgreen274)\
**Post date:** [June 28, 2024, 9:25am UTC](https://community.openai.com/t/in-which-openai-version-is-batch-api-and-files-api-supported/844388/1 "2024-06-28T09:25:34Z")

</div>

I am using the version 1.30.0 . Will there be any problem will the following code ?

import os  
from openai import OpenAI

client = OpenAI(  
api\_key=os.getenv(“OPENAI\_API\_KEY”)  
)

batch\_input\_file = client.files.create(  
file=open(“batchinput.jsonl”, “rb”),  
purpose=“batch”  
)

client.batches.create(  
input\_file\_id=batch\_input\_file\_id,  
endpoint=“/v1/chat/completions”,  
completion\_window=“24h”,  
metadata={  
“description”: “nightly eval job”  
}  
)

client.batches.retrieve(“batch\_abc123”)
