SShortSingh.
Back to feed

Calling Gemini via the OpenAI SDK: What Maps, What Breaks, and the Cost Impact

0
·4 views

A basic migration to Gemini using the OpenAI SDK requires only changing the base URL, API key, and model name, and this works for simple chat completions, streaming, and image input. The compatibility layer breaks down for more advanced features, since fields like system prompts, generation parameters, and caching sit at different structural depths than in OpenAI's format. Reasoning effort maps to different thinking levels or token budgets depending on the model family, and in newer Gemini models reasoning cannot be disabled, which can noticeably raise costs. Some Gemini-specific controls such as caching, safety settings, and search grounding are only accessible through an extra_body parameter with no OpenAI equivalent. Sending both reasoning_effort and thinking_config together produces a validation error rather than merging them.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Kedacom Phoenix flaw CVE-2023-54425 enables unauthenticated file writes outside upload directory

A public advisory describes CVE-2023-54425, an unauthenticated file-upload weakness in the Kedacom Phoenix streaming media server up to release 1R2SP8Fix5L. The vulnerable path is /pmc-bin/upload_fcgi, which can let an attacker write files outside the intended upload directory. Analysts note that search engine results showing Kedacom-branded assets do not confirm firmware versions, endpoint reachability, or whether a write would succeed. Organizations are advised to match exposed candidates against their own asset records, review reverse-proxy rules, and restrict management access. The public record does not identify a fixed release, so vendor confirmation and isolation of affected appliances are recommended.

0
ProgrammingDEV Community ·

Designing Crypto Price Widgets to Separate Quotes, Scenarios and Cost Estimates

A price widget may display market values, projected values and purchase estimates using similar formatting, even though they represent different kinds of data. The article argues that developers should keep these categories distinct, since a scenario calculated from a slider should never be mistaken for an executable quote. It recommends modeling each value with an explicit kind, currency and timestamp, ideally using a discriminated union in typed code. A simple constant-rate compounding formula is presented, with the caveat that the growth period and horizon must match. The author also provides a small JavaScript example that validates inputs and returns a labeled scenario object, noting that the bounds are design choices rather than market claims.

0
ProgrammingDEV Community ·

NVIDIA mở mã nguồn Aerial Sense, biến sóng 5G và 6G thành cảm biến phát hiện vật thể

NVIDIA đã phát hành mã nguồn mở Aerial Sense, bộ công cụ gồm phần mềm lõi, công cụ phát triển, tập dữ liệu và ứng dụng mẫu. Bộ công cụ này cho phép khai thác sóng di động 5G và 6G để phát hiện, theo dõi và định vị vật thể mà không cần thêm phần cứng radar. Giải pháp chạy đồng thời ngăn xếp 5G tăng tốc CUDA và các tác vụ AI trên nền tảng NVIDIA Aerial RAN Computer. Theo số liệu được công bố, mô hình Neural MTI đạt độ chính xác cao hơn 1,4 lần và giúp robot phản hồi nhanh gần 2 lần so với xử lý qua đám mây. Hệ sinh thái đối tác gồm WNC, DeepSig, Unikie, VIAVI và Booz Allen đang tham gia phát triển và thử nghiệm giải pháp.

0
ProgrammingDEV Community ·

NetKaç, Türkiye için anahtarsız ücretsiz maaş, vergi ve kredi hesaplama API'sini açtı

NetKaç, Türkiye'deki maaş, vergi, tazminat ve kredi hesaplamalarını yapan hesaplama motorunu ücretsiz bir REST API olarak erişime açtı. Sistem, asgari ücret, gelir vergisi dilimleri, SGK tavanı, kıdem tazminatı tavanı ve KKDF/BSMV gibi oranları Resmî Gazete, GİB, SGK, TÜİK ve TCMB kaynaklarından güncel tutuyor. API, brütten nete ve netten brüte maaş, kıdem ve ihbar tazminatı, kredi taksitleri, KDV, kira artış üst sınırı, gelir vergisi tarifesi ve mevduat getirisi gibi hesaplamaları kapsıyor. Geliştiriciler için API anahtarı gerekmiyor, OpenAPI tanımı ve bir MCP sunucusu da sağlanıyor. Sonuçların bilgilendirme amaçlı olduğu ve kaynak olarak netkac.com'un belirtilmesi isteniyor.