---
title: "Laravel AI: Get Raw HTTP Responses and Rate Limits"
url: https://daily.dev/posts/laravel-ai-get-raw-http-responses-and-rate-limits-kjggpjlj3
source_url: https://laravel-news.com/laravel-ai-raw-http-response
type: article
source: "Laravel News"
published: 2026-08-24T13:45:00.740Z
updated: 2026-08-24T13:45:27.082Z
tags: ["php", "laravel"]
reading_time: 4
upvotes: 8
comments: 2
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel AI: Get Raw HTTP Responses and Rate Limits

**[Laravel News](https://daily.dev/sources/ln)** · 4 min read · 8 upvotes · 2 comments

## Summary

Laravel AI SDK version 0.10.3 adds a public `raw` property to response objects, exposing the underlying HTTP client response so developers can read provider-specific data like rate limit headers, request ids, and payload fields not covered by the SDK's generic response shape. Each step in a multi-step agent run keeps its own `raw`, and event listeners can access it via the response carried on events like AgentPrompted. The property returns null for streamed responses, Bedrock (which uses the AWS SDK instead of an HTTP client), serialized responses that have passed through a queue or cache, and faked agents unless a fake raw response is supplied via `withRawResponse()`. The newest release, v0.11.0, extends this with lifecycle events and timings for steps and tool calls.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/laravel-ai-raw-http-response>

## Questions this post answers

### How do I read rate limit headers from a Laravel AI SDK response?

Access the `raw` property on the response object, which holds the underlying Illuminate\Http\Client\Response from the provider call. For example, `$response->raw->header('x-ratelimit-remaining-requests')` returns the remaining request count. This property shipped in Laravel AI SDK version 0.10.3, released August 6, 2026, added via pull request #714.

_daily.dev surfaces Laravel AI SDK updates like this for teams tracking rate limits in production._

### Why is the raw property null on my Laravel AI SDK response?

Four cases return null: streamed responses (via stream() or the AgentStreamed event), Bedrock calls (since the AWS SDK handles the request instead of an HTTP client), serialized responses that passed through a queue or cache (raw is dropped during __serialize() because Guzzle streams cannot be serialized), and faked agents unless a fake raw response is explicitly supplied.

_Developers debugging AI SDK edge cases can follow Laravel AI changes on daily.dev._

### How do I fake a raw HTTP response for testing Laravel AI rate limit handling?

Use `withRawResponse()` on a fake response, passing an Illuminate\Http\Client\Response wrapping a Guzzle Psr7 Response with the desired headers. For example, chain it onto TextResponse::fake() with a Psr7Response containing headers like 'x-ratelimit-remaining-requests' set to '99', then assert your listener behaves correctly. Note the method is withRawResponse(), not withRaw().

_daily.dev helps developers testing AI rate-limit logic keep up with Laravel AI SDK changes._

## Community discussion

Top comments from developers on daily.dev.

**@rgodiyal** · 0 upvotes

> ![GIF](https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/e8/e8/9SeP9Sh2LuGoNYsE.gif)

## Similar posts on daily.dev

- [Agent Run Observability in Laravel AI SDK 0.11](https://daily.dev/posts/agent-run-observability-in-laravel-ai-sdk-0-11-2ws8tt7cm) · Laravel News · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel)

[View this post on daily.dev](https://daily.dev/posts/laravel-ai-get-raw-http-responses-and-rate-limits-kjggpjlj3)
