Skip to content
BENIBIX Learn

API_TIMEOUT_MS

AI⌨️ Claude CodeConfiguration

Also known as API_TIMEOUT_MS environment variable

It sets how long an API request waits for its reply to start.

Think of it like

It is like how long you wait for someone to pick up the phone.

Example

Emma's requests go through a slow company proxy and keep timing out. She raises the wait, and they get through.

Why it matters

On a slow network, a short wait turns a working request into an error.

Definition

API_TIMEOUT_MS sets how long each API request waits for its reply to begin. The value is in milliseconds, and the default is 600,000, which is 10 minutes. It does not limit how long a streamed reply runs after that. Set 0 to remove the limit, which needs version 2.1.305 or later.

Example code

bash
export API_TIMEOUT_MS=900000
claude
Wait up to 15 minutes for a reply to start.

Common mistake

Raising it to stop long replies being cut. It only covers the wait for the reply to begin.

Key takeaways

  1. 1
    Wait for the start. Not the whole reply.
  2. 2
    Default 10 minutes. 600,000.
  3. 3
    0 removes it. 2.1.305 or later.