$headers */ private function __construct(private readonly array $headers) { // .. } /** * Creates a new Headers value object with the given API token. */ public static function withAuthorization(ApiKey $apiKey): self { return new self([ 'Authorization' => "Bearer {$apiKey->toString()}", ]); } /** * Creates a new Headers value object, with the given content type, and the existing headers. */ public function withContentType(ContentType $contentType, string $suffix = ''): self { return new self([ ...$this->headers, 'Content-Type' => $contentType->value.$suffix, ]); } /** * Creates a new Headers value object, with the given organization, and the existing headers. */ public function withOrganization(string $organization): self { return new self([ ...$this->headers, 'OpenAI-Organization' => $organization, ]); } /** * @return array $headers */ public function toArray(): array { return $this->headers; } }