{"id":48436,"date":"2025-07-10T14:27:25","date_gmt":"2025-07-10T18:27:25","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=48436"},"modified":"2025-07-10T14:27:25","modified_gmt":"2025-07-10T18:27:25","slug":"how-to-use-google-gemini-in-xcode-26-beta","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/07\/10\/how-to-use-google-gemini-in-xcode-26-beta\/","title":{"rendered":"How to Use Google Gemini in Xcode 26 Beta"},"content":{"rendered":"<p><a href=\"https:\/\/zottmann.org\/2025\/06\/13\/how-to-use-google-gemini.html\">Carlo Zottmann<\/a>:<\/p>\n<blockquote cite=\"https:\/\/zottmann.org\/2025\/06\/13\/how-to-use-google-gemini.html\">\n<p>Google <a href=\"https:\/\/ai.google.dev\/gemini-api\/docs\/openai#rest\">offers an OpenAI-compatible API for Gemini<\/a>, and while working, it is not what Xcode expects in terms of URL layout. In Xcode&rsquo;s LLM provider config, the custom &ldquo;URL&rdquo; parameter is the API&rsquo;s base URL up to <strong>but not including<\/strong> the <code>v1\/<\/code> path segment, e.g. <code>https:\/\/api.openai.com\/<\/code> instead of the full <code>https:\/\/api.openai.com\/v1\/<\/code>. When making calls to the provider later on, Xcode will automatically append the endpoint path (e.g. <code>v1\/models<\/code> etc.) to that URL.<\/p>\n<p>Now, the Gemini URL structure breaks with the <code>v1\/<\/code> convention: its URL is <code>https:\/\/generativelanguage.googleapis.com\/v1beta\/openai\/<\/code> instead of <code>https:\/\/generativelanguage.googleapis.com\/v1\/<\/code>. You can see why this might be a problem.<\/p>\n<p>So here&rsquo;s how to set up both Xcode and a proxy app to use Google&rsquo;s offerings.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/07\/09\/xcode-26-beta-3\/\">Xcode 26 Beta 3<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/06\/19\/swift-assist-part-deux\/\">Swift Assist, Part Deux<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/05\/05\/xcode-claude\/\">Xcode + Claude<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Carlo Zottmann: Google offers an OpenAI-compatible API for Gemini, and while working, it is not what Xcode expects in terms of URL layout. In Xcode&rsquo;s LLM provider config, the custom &ldquo;URL&rdquo; parameter is the API&rsquo;s base URL up to but not including the v1\/ path segment, e.g. https:\/\/api.openai.com\/ instead of the full https:\/\/api.openai.com\/v1\/. When making [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-07-10T18:27:28Z","apple_news_api_id":"c5845ece-b656-484e-ba6f-4b5fff0186cc","apple_news_api_modified_at":"2025-07-10T18:27:28Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AxYRezrZWSE66b0tf_wGGzA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[1351,2347,30,2742,71,1830,226],"class_list":["post-48436","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-artificial-intelligence","tag-bard","tag-mac","tag-macos-tahoe-26","tag-programming","tag-proxyman","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/48436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=48436"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/48436\/revisions"}],"predecessor-version":[{"id":48437,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/48436\/revisions\/48437"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=48436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=48436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=48436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}