Skip to content

400 Bad Request when placing order on demo environment #15

@hjensen

Description

@hjensen

I'm attempting to run this bot on the Kalshi demo environment but running into an error on the final step of placing the order. Here is the error:

2025-12-31 13:16:20.690 | ERROR | kalshi_client:place_order:438 - Error placing order: Client error '400 Bad Request' for url 'https://demo-api.kalshi.co/trade-api/v2/portfolio/orders'

The URL seems correct, and I added logging to look at the order data which is here:

2025-12-31 13:16:15.405 | INFO | kalshi_client:place_order:420 - order_data: {'ticker': 'KXHIGHLAX-25DEC31-B67.5', 'side': 'no', 'action': 'buy', 'type': 'market', 'client_order_id': 'e18e189e-dc5a-447a-926d-dbd6be6b6076', 'count': 1000, 'buy_max_cost': 2500}

I have additionally checked the headers and I can see the timestamp, access-key, and access-signature and they all look correct.

Any ideas what might be causing this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions