Sand AISand AI MAGI-2MAGI-2 jest teraz na SandBase: wideo 1080p z natywnym dźwiękiemWypróbuj teraz

X-Rates Convert Currency

Dokumentacja API
https://api.sandbase.ai/v1/api/x-rates/convert-currency

Performs a currency conversion from one currency to another for a given amount. Returns the converted value and a text representation. Conversion uses the latest available rate.

Cena
$0.03USD / wywołanie
Metoda
POST
Odpowiedź
JSON
Parametry
2 wymaganych · 1 opcjonalnych

Playground

Wejście
Target currency code (e.g. EUR, JPY, GBP).
Source currency code (e.g. USD, EUR, GBP).
Amount to convert.
WyjścieGotowe

Twój wynik pojawi się tutaj

Uzupełnij dane wejściowe, a następnie kliknij Uruchom.

README API

X-Rates Convert Currency API

Performs a currency conversion from one currency to another for a given amount. Returns the converted value and a text representation. Conversion uses the latest available rate.

Request

curl -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "x-rates/convert-currency", "to": "EUR", "from": "USD", "amount": 100.0}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
fromstringYesSource currency code (e.g. USD, EUR, GBP). One of: USD, EUR, GBP, JPY, CHF, CAD, AUD.
tostringYesTarget currency code (e.g. EUR, JPY, GBP).
amountnumberNoAmount to convert.

Pricing

Flat $0.03 per call. Failed calls are not charged.

Odkryj więcej

Powiązane APIs

Wszystkie APIs
APICenaOdpowiedź
X-Rates$0.03 za wywołanieJSON
X-Rates$0.03 za wywołanieJSON
X-Rates$0.03 za wywołanieJSON
X-Rates$0.03 za wywołanieJSON
X-Rates$0.03 za wywołanieJSON
X-Rates$0.03 za wywołanieJSON

Pytania

FAQ

Jak używać API X-Rates Convert Currency?

Wyślij żądanie POST do https://api.sandbase.ai/v1/api/x-rates/convert-currency z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.

Ile kosztuje API X-Rates Convert Currency?

$0.03 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.

Jakie parametry przyjmuje API X-Rates Convert Currency?

Wymagane: to (string) i from (jedna z opcji: USD, EUR, GBP, JPY, CHF, CAD, AUD). Opcjonalne: amount (number). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.

Co zwraca API X-Rates Convert Currency?

Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie).

Czy potrzebuję konta deweloperskiego X-Rates lub klucza API?

Nie. X-Rates Convert Currency działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API X-Rates.