{"id":12,"date":"2025-09-26T08:50:42","date_gmt":"2025-09-26T08:50:42","guid":{"rendered":"https:\/\/ska-blocks.com\/docs\/2025\/09\/26\/using-ai\/"},"modified":"2025-09-26T09:43:49","modified_gmt":"2025-09-26T09:43:49","slug":"using-ai","status":"publish","type":"post","link":"https:\/\/ska-blocks.com\/docs\/using-ai\/","title":{"rendered":"Using AI"},"content":{"rendered":"\n<p class=\"lead\">The <a href=\"https:\/\/ska-blocks.com\/docs\/ska-blocks\/tailwind-block\/\" data-type=\"post\" data-id=\"217\">Tailwind block<\/a> of <a href=\"https:\/\/wordpress.org\/plugins\/ska-blocks\/\" target=\"_blank\" rel=\"noreferrer noopener\">ska-blocks WordPress plugin<\/a> allows communicating with a GPT to generate Tailwind HTML, which can then be converted to WordPress blocks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">API key<\/h2>\n\n\n\n<p>ska-blocks uses OpenRouter to facilitate interaction with multiple GPTs through a unified API.<\/p>\n\n\n\n<p>First, set up your <a href=\"https:\/\/openrouter.ai\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenRouter.ai<\/a> API key and a model to use under <strong>ska-blocks -> Options -> AI<\/strong>:<\/p>\n\n\n\n<img loading=\"lazy\" decoding=\"sync\" class=\"ring ring-site-border wp-block-ska-image image\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-21.png\" alt=\"ska-blocks options for configuring OpenRouter API key and models\" width=\"280\" height=\"568\"\/>\n\n\n\n<p>Models can be found at <a href=\"https:\/\/openrouter.ai\/models\" target=\"_blank\" rel=\"noreferrer noopener\">OpenRouter -&gt; Models<\/a>, for example, for the free <a href=\"https:\/\/openrouter.ai\/cognitivecomputations\/dolphin3.0-mistral-24b:free\" target=\"_blank\" rel=\"noreferrer noopener\">Dolphin3.0 Mistral 24B<\/a> model you should enter <code>cognitivecomputations\/dolphin3.0-mistral-24b:free<\/code> to the OpenRouter model option.<\/p>\n\n\n\n<p>You can also enter a fallback model for when the primary model&#8217;s providers are down, rate-limited, or refuse to reply due to content moderation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add Tailwind block<\/h2>\n\n\n\n<p>Add the Tailwind block and press &#8220;AI&#8221; on the toolbar:<\/p>\n\n\n\n<div aria-hidden=\"true\" class=\"ring wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-10.png\" width=\"809\" height=\"70\" loading=\"lazy\"\/><\/div>\n\n\n\n<p>Choose a suggestion or write a prompt:<\/p>\n\n\n\n<div role=\"figure\" class=\"inline-block p-4 rounded-lg ring shadow-lg wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-22.png\" alt=\"Prompting an AI with ska-blocks plugin using the Tailwind block with the prompt &quot;Three modern creative landing page sections for a bakery in Dublin. Don't include a header or footer.&quot;\" width=\"488\" height=\"490\" loading=\"lazy\"\/><\/div>\n\n\n\n<p>There&#8217;s also an option to pick a different model to use for this specific session.<\/p>\n\n\n\n<p>Once the GPT has returned a response, its&#8217; output will be inserted to the Tailwind block:<\/p>\n\n\n\n<div aria-hidden=\"true\" class=\"ring wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-23.png\" width=\"732\" height=\"442\" loading=\"lazy\"\/><\/div>\n\n\n\n<p>You can switch to the <strong>Preview<\/strong> tab to see what the HTML looks like when rendered:<\/p>\n\n\n\n<img decoding=\"async\" aria-hidden=\"true\" class=\"ring wp-block-ska-image image\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-13.png\" loading=\"lazy\"\/>\n\n\n\n<p>Results will vary depending on the model used and your prompt:<\/p>\n\n\n\n<a aria-label=\"View image in full screen\" data-pswp-height=\"1019\" data-pswp-width=\"1000\" data-ska-pswp=\"ska-pswp-1\" href=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-24.png\" class=\"ring ring-site-border wp-block-ska-image image\"><img decoding=\"async\" aria-hidden=\"true\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-24.png\" width=\"1000\" height=\"1019\" loading=\"lazy\"\/><\/a>\n\n\n\n<p>To make modifications you can press the AI button again to continue the session and ask for changes.<\/p>\n\n\n\n<p>Once you&#8217;re happy with the result you can press <strong>Convert to blocks<\/strong>:<\/p>\n\n\n\n<img decoding=\"async\" aria-hidden=\"true\" class=\"ring wp-block-ska-image image\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-15.png\" width=\"306\" height=\"58\" loading=\"lazy\"\/>\n\n\n\n<p>Once converted you can remove the Tailwind block and edit the content as blocks:<\/p>\n\n\n\n<a aria-label=\"View image in full screen\" data-pswp-height=\"1143\" data-pswp-width=\"999\" data-ska-pswp=\"ska-pswp-2\" href=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-25.png\" class=\"ring ring-site-border wp-block-ska-image image\"><img decoding=\"async\" src=\"https:\/\/ska-blocks.com\/docs\/wp-content\/uploads\/sites\/3\/2025\/03\/image-25.png\" alt=\"AI-generated Tailwind HTML converted to WordPress blocks\" width=\"999\" height=\"1143\" loading=\"lazy\"\/><\/a>\n\n\n\n<p>It&#8217;s very easy for anyone to make basic text changes, how ever to make design and layout changes you&#8217;ll need to be familiar with the <a href=\"https:\/\/tailwindcss.com\/docs\/styling-with-utility-classes\" target=\"_blank\" rel=\"noreferrer noopener\">core concepts of Tailwind classes<\/a> and the WordPress Block Editor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Alternatives<\/h2>\n\n\n\n<p>You can also use any other AI chat service to have it generate Tailwind HTML for you and simply manually paste it to the Tailwind block to convert it to blocks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s the best model to use for Tailwind HTML?<\/h2>\n\n\n\n<p>I have no idea, there are so many models out there. <br>Here&#8217;s what DeepSeek R1 thinks:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p data-ai-generated=\"true\" aria-label=\"This text was generated by an AI\" class=\"wp-block-ska-text ska-text\">The <strong>GPT-4<\/strong> model is ideal for generating clean HTML with Tailwind CSS due to its strong grasp of semantic markup and utility-first frameworks. It excels at applying responsive modifiers like <em>md:<\/em> and <em>lg:<\/em>, crafting dynamic states with <em>hover:<\/em> or <em>focus:<\/em> prefixes, and organizing atomic classes efficiently. Ensure your prompt specifies mobile-first breakpoints and design requirements for optimal class selection.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Downsides to generating UI with GPTs<\/h2>\n\n\n\n<p>As AIs always use their own Tailwind classes for common UI elements like buttons, menus and headings your site can become very inconsistent, using various different colors, spacings, font sizes and weights.<\/p>\n\n\n\n<p>It&#8217;s recommended to go over all newly AI-generated blocks and try to remove unnecessary font sizes and weights from headings, strip classes from buttons and apply a common &#8220;Button&#8221; <a href=\"https:\/\/ska-blocks.com\/docs\/ska-blocks\/presets\/\" data-type=\"post\" data-id=\"327\">preset<\/a> instead, things like that.<\/p>\n\n\n\n<p>You can also take parts of the UI and make <a href=\"https:\/\/ska-blocks.com\/docs\/ska-blocks\/variations\/\" data-type=\"post\" data-id=\"339\">variations<\/a> out of them to reuse them as blocks elsewhere on the site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Tailwind block of ska-blocks WordPress plugin allows communicating with a GPT to generate Tailwind HTML, which can then be converted to WordPress blocks. API key ska-blocks uses OpenRouter to facilitate interaction with multiple GPTs through a unified API. First, set up your OpenRouter.ai API key and a model to use under ska-blocks -> Options&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[6],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-ska-blocks","tag-ai"],"_links":{"self":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":1,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":226,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/posts\/12\/revisions\/226"}],"wp:attachment":[{"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ska-blocks.com\/docs\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}