diff --git a/specs/curl/inspect_giky_api_model_rates.yaml b/specs/curl/inspect_giky_api_model_rates.yaml new file mode 100644 index 00000000..bbbf2e1a --- /dev/null +++ b/specs/curl/inspect_giky_api_model_rates.yaml @@ -0,0 +1,33 @@ +--- +name: Inspect Giky API model rates with curl and jq +command: |- + ( + set -o pipefail + printf 'Enter a Giky API model slug: ' >&2 + IFS= read -r giky_slug + case "$giky_slug" in + ''|*[!a-zA-Z0-9._-]*) printf 'Enter a valid model slug.\n' >&2; exit 2 ;; + esac + curl --fail --silent --show-error --max-time 12 \ + --header 'Accept: application/json' \ + 'https://gikyapi.com/api/catalog' | + jq --exit-status --arg slug "$giky_slug" ' + .currency as $currency | + [.models[] | select(.slug == $slug)] | + if length == 1 then .[0] + else error("Expected a single matching model in the public catalog") + end | + {model: .slug, kind, currency: $currency, generationAvailable, + priceRows: [(.prices // [])[] | {operation, amount, unit, resolution, duration, when}]} + ' + ) +tags: + - curl + - api +description: Inspect operation, resolution, duration, amount and unit for a Giky API model before quoting an image or video workflow. Requires curl and jq. Reads the public catalog without credentials or media generation. +source_url: https://gikyapi.com/docs/ +author: shisan12323 +author_url: https://github.com/shisan12323 +shells: + - bash + - zsh