{"id":197,"date":"2023-03-31T10:37:09","date_gmt":"2023-03-31T10:37:09","guid":{"rendered":"https:\/\/www.devopsconsulting.in\/blog\/?p=197"},"modified":"2023-04-01T09:07:47","modified_gmt":"2023-04-01T09:07:47","slug":"resources-available-for-api-in-dall-e-2","status":"publish","type":"post","link":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/","title":{"rendered":"Resources available for api in dall-e-2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>These are resources available for api in dall-e-2<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Images Resource<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>create<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method : <\/strong>ImagesGenerations::create()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The method may accept the following parameters:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$prompt:<\/strong> The text description of the image to be generated.<\/li>\n\n\n\n<li>$apiKey: The API key or token required to access the DALL-E API.<\/li>\n\n\n\n<li><strong>$model: <\/strong>The name or ID of the DALL-E model to be used for image generation. (Optional)<\/li>\n\n\n\n<li><strong>$size:<\/strong> The size of the output image in pixels, specified as a width-height tuple. For example, &#8220;512&#215;512&#8221;. (Optional)<\/li>\n\n\n\n<li><strong>$n:<\/strong> The number of images to generate for the given text description. Defaults to 1 if not specified. (Optional)<\/li>\n\n\n\n<li><strong>$response_format: <\/strong>The format of the response, either &#8220;json&#8221; or &#8220;image&#8221;. If &#8220;json&#8221; is selected, the method will return a JSON object containing the URL of the generated image(s). If &#8220;image&#8221; is selected, the method will download the image(s) to the specified directory. (Optional)<\/li>\n\n\n\n<li><strong>$response_dir:<\/strong> The directory where the generated image(s) should be saved if the $response_format parameter is set to &#8220;image&#8221;. (Optional)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$response = $client->images()->create(&#91;\r\n    'prompt' => 'A cute baby sea otter',\r\n    'n' => 1,\r\n    'size' => '256x256',\r\n    'response_format' => 'url',\r\n]);\r\nparameter\r\n\r\n{\r\n  \"prompt\": \"A cute baby sea otter\",\r\n  \"n\": 2,\r\n  \"size\": \"1024x1024\"\r\n}\n\nUrl=POST https:\/\/api.openai.com\/v1\/images\/generations<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">edit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Creates an edited or extended image given an original image and a prompt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method:<\/strong> ImagesEdits::createImage()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The method may accept the following parameters:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$image_url:<\/strong> The URL of the image to be edited.<\/li>\n\n\n\n<li><strong>$attributes:<\/strong> An associative array of attribute keys and values that should be modified. For example, array(&#8216;color&#8217; => &#8216;red&#8217;, &#8216;texture&#8217; => &#8216;smooth&#8217;). The available attributes depend on the DALL-E model being used.<\/li>\n\n\n\n<li><strong>$apiKey:<\/strong> The API key or token required to access the DALL-E API.<\/li>\n\n\n\n<li>$model: The name or ID of the DALL-E model to be used for image editing. (Optional)<\/li>\n\n\n\n<li><strong>$response_format:<\/strong> The format of the response, either &#8220;json&#8221; or &#8220;image&#8221;. If &#8220;json&#8221; is selected, the method will return a JSON object containing the URL of the edited image. If &#8220;image&#8221; is selected, the method will download the edited image to the specified directory. (Optional)<\/li>\n\n\n\n<li><strong>$response_dir:<\/strong> The directory where the edited image should be saved if the $response_format parameter is set to &#8220;image&#8221;. (Optional)<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$response = $client->images()->edit(&#91;\n    'image' => fopen('image_edit_original.png', 'r'),   \/\/ parameter 1\n    'mask' => fopen('image_edit_mask.png', 'r'),        \/\/ parameter 2\n    'prompt' => 'A sunlit indoor lounge area with a pool', \/\/ parameter 3\n    'n' => 1,                                             \/\/ parameter 4\n    'size' => '256x256',                                  \/\/ parameter 5\n    'response_format' => 'url',                           \/\/ parameter 6\n]);\n\n$response->created; \n\nforeach ($response->data as $data) {\n    $data->url; \n    $data->b64_json; \n}\n$response->toArray(); <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Variation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Creates a variation of a given image.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method<\/strong> : ImagesVariations::createImage()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The method may accept the following parameters:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$image_url:<\/strong> The URL of the image to be varied.<\/li>\n\n\n\n<li><strong>$variation_type: <\/strong>The type of variation to be applied to the image. Possible values are &#8220;zoom&#8221;, &#8220;rotate&#8221;, &#8220;shift&#8221;, &#8220;color&#8221;, &#8220;texture&#8221;, &#8220;pattern&#8221;, &#8220;jitter&#8221;, &#8220;brightness&#8221;, &#8220;contrast&#8221;, &#8220;saturation&#8221;, &#8220;noise&#8221;, and &#8220;blur&#8221;.<\/li>\n\n\n\n<li><strong>$apiKey:<\/strong> The API key or token required to access the DALL-E API.<\/li>\n\n\n\n<li><strong>$model:<\/strong> The name or ID of the DALL-E model to be used for image variation. (Optional)<\/li>\n\n\n\n<li><strong>$response_format:<\/strong> The format of the response, either &#8220;json&#8221; or &#8220;image&#8221;. If &#8220;json&#8221; is selected, the method will return a JSON object containing the URL of the generated image(s). If &#8220;image&#8221; is selected, the method will download the generated image(s) to the specified directory. (Optional)<\/li>\n\n\n\n<li><strong>$response_dir:<\/strong> The directory where the generated image(s) should be saved if the $response_format parameter is set to &#8220;image&#8221;. (Optional)<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$response = $client->images()->variation(&#91;\r\n    'image' => fopen('image_edit_original.png', 'r'), \/\/parameter 1\r\n    'n' => 1,                                         \/\/parameter 2\r\n    'size' => '256x256',                              \/\/parameter 3\r\n    'response_format' => 'url',                       \/\/parameter 4\r\n]);\n\nurl = POST https:\/\/api.openai.com\/v1\/images\/variations\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>These are resources available for api in dall-e-2 Images Resource create Method : ImagesGenerations::create() The method may accept the following parameters: edit Creates an edited or extended&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Resources available for api in dall-e-2 - DevOps Consulting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Resources available for api in dall-e-2 - DevOps Consulting\" \/>\n<meta property=\"og:description\" content=\"These are resources available for api in dall-e-2 Images Resource create Method : ImagesGenerations::create() The method may accept the following parameters: edit Creates an edited or extended...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-31T10:37:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-01T09:07:47+00:00\" \/>\n<meta name=\"author\" content=\"Abhishek Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abhishek Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/\"},\"author\":{\"name\":\"Abhishek Singh\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#\\\/schema\\\/person\\\/fc397ba8be42f9fdd53450edfc73006f\"},\"headline\":\"Resources available for api in dall-e-2\",\"datePublished\":\"2023-03-31T10:37:09+00:00\",\"dateModified\":\"2023-04-01T09:07:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/\"},\"wordCount\":480,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/\",\"url\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/\",\"name\":\"Resources available for api in dall-e-2 - DevOps Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#website\"},\"datePublished\":\"2023-03-31T10:37:09+00:00\",\"dateModified\":\"2023-04-01T09:07:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#\\\/schema\\\/person\\\/fc397ba8be42f9fdd53450edfc73006f\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/resources-available-for-api-in-dall-e-2\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/\",\"name\":\"DevOps Consulting\",\"description\":\"DevOps Consulting | SRE Consulting | DevSecOps Consulting | MLOps Consulting\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#\\\/schema\\\/person\\\/fc397ba8be42f9fdd53450edfc73006f\",\"name\":\"Abhishek Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"caption\":\"Abhishek Singh\"},\"description\":\"I\u2019m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I\u2019ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains: \u2022 DevOps School \u2013 Tech blogs and tutorials \u2022 Holiday Landmark \u2013 Travel stories and guides \u2022 Stocks Mantra \u2013 Stock market strategies and tips \u2022 My Medic Plus \u2013 Health and fitness guidance \u2022 TrueReviewNow \u2013 Honest product reviews \u2022 Wizbrand \u2013 SEO and digital tools for businesses I\u2019m also exploring the fascinating world of Quantum Computing.\",\"url\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/author\\\/abhishek\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Resources available for api in dall-e-2 - DevOps Consulting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/","og_locale":"en_US","og_type":"article","og_title":"Resources available for api in dall-e-2 - DevOps Consulting","og_description":"These are resources available for api in dall-e-2 Images Resource create Method : ImagesGenerations::create() The method may accept the following parameters: edit Creates an edited or extended...","og_url":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/","og_site_name":"DevOps Consulting","article_published_time":"2023-03-31T10:37:09+00:00","article_modified_time":"2023-04-01T09:07:47+00:00","author":"Abhishek Singh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abhishek Singh","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/#article","isPartOf":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/"},"author":{"name":"Abhishek Singh","@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f"},"headline":"Resources available for api in dall-e-2","datePublished":"2023-03-31T10:37:09+00:00","dateModified":"2023-04-01T09:07:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/"},"wordCount":480,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/","url":"https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/","name":"Resources available for api in dall-e-2 - DevOps Consulting","isPartOf":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/#website"},"datePublished":"2023-03-31T10:37:09+00:00","dateModified":"2023-04-01T09:07:47+00:00","author":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsconsulting.in\/blog\/resources-available-for-api-in-dall-e-2\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.devopsconsulting.in\/blog\/#website","url":"https:\/\/www.devopsconsulting.in\/blog\/","name":"DevOps Consulting","description":"DevOps Consulting | SRE Consulting | DevSecOps Consulting | MLOps Consulting","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsconsulting.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f","name":"Abhishek Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","caption":"Abhishek Singh"},"description":"I\u2019m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I\u2019ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains: \u2022 DevOps School \u2013 Tech blogs and tutorials \u2022 Holiday Landmark \u2013 Travel stories and guides \u2022 Stocks Mantra \u2013 Stock market strategies and tips \u2022 My Medic Plus \u2013 Health and fitness guidance \u2022 TrueReviewNow \u2013 Honest product reviews \u2022 Wizbrand \u2013 SEO and digital tools for businesses I\u2019m also exploring the fascinating world of Quantum Computing.","url":"https:\/\/www.devopsconsulting.in\/blog\/author\/abhishek\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/197\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}