Class: Telnyx::Models::AIRetrieveModelsResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/ai_retrieve_models_response.rb

Defined Under Namespace

Modules: Tier

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, context_length:, created:, languages:, license:, organization:, owned_by:, parameters:, tier:, base_model: nil, description: nil, is_fine_tunable: nil, is_vision_supported: nil, max_completion_tokens: nil, object: nil, parameters_str: nil, pricing: nil, recommended_for_assistants: nil, regions: nil, task: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::AIRetrieveModelsResponse::Data for more details.

Metadata for a model available on Telnyx Inference. Returned by ‘GET /v2/ai/openai/models` (and the deprecated `GET /v2/ai/models`). Open-source models live under their Hugging Face organization (e.g. `moonshotai/Kimi-K2.6`, `zai-org/GLM-5.1-FP8`, `MiniMaxAI/MiniMax-M2.7`); fine-tuned models are owned by the Telnyx organization that trained them.

Parameters:

  • id (String)

    Model identifier. For open-source models, follows the ‘#organization/{model_nam

  • context_length (Integer)

    Maximum total tokens (prompt + completion) supported by the model in a single re

  • created (Time)

    Timestamp at which the model was registered on Telnyx Inference (ISO 8601).

  • languages (Array<String>)

    ISO language codes the model supports (e.g. ‘en`, `es`).

  • license (String)

    License the model is distributed under, e.g. ‘Apache 2.0`, `MIT`, `Llama 3 Commu

  • organization (String)

    Organization that originally published the model, matching the prefix of ‘id` fo

  • owned_by (String)

    Owner of the model. ‘Telnyx` for Telnyx-hosted open-source models, the upstream

  • parameters (Integer)

    Total parameter count of the model.

  • tier (Symbol, Telnyx::Models::AIRetrieveModelsResponse::Data::Tier)

    Billing tier the model belongs to. Used together with ‘pricing` to determine cos

  • base_model (String, nil) (defaults to: nil)

    Base model the fine-tuned model was trained from. Only set for fine-tuned models

  • description (String, nil) (defaults to: nil)

    Short, human-readable summary of what the model is best suited for.

  • is_fine_tunable (Boolean) (defaults to: nil)

    Whether the model can be used as a base for a fine-tuning job via ‘POST /v2/ai/f

  • is_vision_supported (Boolean) (defaults to: nil)

    Whether the model accepts image inputs in chat completions (multimodal vision su

  • max_completion_tokens (Integer, nil) (defaults to: nil)

    Maximum number of completion (output) tokens the model will generate per request

  • object (String) (defaults to: nil)

    Object type. Always ‘model`.

  • parameters_str (String, nil) (defaults to: nil)

    Human-readable parameter count, e.g. ‘1.0T`, `753.9B`, `8B`.

  • pricing (Hash{Symbol=>String}) (defaults to: nil)

    Mapping of token kind to price, as strings to preserve precision. Typical keys a

  • recommended_for_assistants (Boolean) (defaults to: nil)

    Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI A

  • regions (Array<String>) (defaults to: nil)

    Public region names where the model is currently deployed (e.g. ‘us-central-1`,

  • task (String) (defaults to: nil)

    Primary task the model is intended for, e.g. ‘text-generation`, `audio-text-to-t



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 21

class Data < Telnyx::Internal::Type::BaseModel
  # @!attribute id
  #   Model identifier. For open-source models, follows the
  #   `{organization}/{model_name}` convention from Hugging Face (e.g.
  #   `moonshotai/Kimi-K2.6`).
  #
  #   @return [String]
  required :id, String

  # @!attribute context_length
  #   Maximum total tokens (prompt + completion) supported by the model in a single
  #   request.
  #
  #   @return [Integer]
  required :context_length, Integer

  # @!attribute created
  #   Timestamp at which the model was registered on Telnyx Inference (ISO 8601).
  #
  #   @return [Time]
  required :created, Time

  # @!attribute languages
  #   ISO language codes the model supports (e.g. `en`, `es`).
  #
  #   @return [Array<String>]
  required :languages, Telnyx::Internal::Type::ArrayOf[String]

  # @!attribute license
  #   License the model is distributed under, e.g. `Apache 2.0`, `MIT`,
  #   `Llama 3 Community License`.
  #
  #   @return [String]
  required :license, String

  # @!attribute organization
  #   Organization that originally published the model, matching the prefix of `id`
  #   for open-source models.
  #
  #   @return [String]
  required :organization, String

  # @!attribute owned_by
  #   Owner of the model. `Telnyx` for Telnyx-hosted open-source models, the upstream
  #   provider name for proxied models, or the Telnyx organization id for fine-tuned
  #   models.
  #
  #   @return [String]
  required :owned_by, String

  # @!attribute parameters
  #   Total parameter count of the model.
  #
  #   @return [Integer]
  required :parameters, Integer

  # @!attribute tier
  #   Billing tier the model belongs to. Used together with `pricing` to determine
  #   cost per 1M tokens.
  #
  #   @return [Symbol, Telnyx::Models::AIRetrieveModelsResponse::Data::Tier]
  required :tier, enum: -> { Telnyx::Models::AIRetrieveModelsResponse::Data::Tier }

  # @!attribute base_model
  #   Base model the fine-tuned model was trained from. Only set for fine-tuned
  #   models.
  #
  #   @return [String, nil]
  optional :base_model, String, nil?: true

  # @!attribute description
  #   Short, human-readable summary of what the model is best suited for.
  #
  #   @return [String, nil]
  optional :description, String, nil?: true

  # @!attribute is_fine_tunable
  #   Whether the model can be used as a base for a fine-tuning job via
  #   `POST /v2/ai/fine_tuning/jobs`.
  #
  #   @return [Boolean, nil]
  optional :is_fine_tunable, Telnyx::Internal::Type::Boolean

  # @!attribute is_vision_supported
  #   Whether the model accepts image inputs in chat completions (multimodal vision
  #   support).
  #
  #   @return [Boolean, nil]
  optional :is_vision_supported, Telnyx::Internal::Type::Boolean

  # @!attribute max_completion_tokens
  #   Maximum number of completion (output) tokens the model will generate per
  #   request. `null` if unconstrained beyond `context_length`.
  #
  #   @return [Integer, nil]
  optional :max_completion_tokens, Integer, nil?: true

  # @!attribute object
  #   Object type. Always `model`.
  #
  #   @return [String, nil]
  optional :object, String

  # @!attribute parameters_str
  #   Human-readable parameter count, e.g. `1.0T`, `753.9B`, `8B`.
  #
  #   @return [String, nil]
  optional :parameters_str, String, nil?: true

  # @!attribute pricing
  #   Mapping of token kind to price, as strings to preserve precision. Typical keys
  #   are `prompt`, `cached_prompt`, and `completion`. When pricing is available the
  #   block also includes `currency` (ISO 4217 code matching the account's configured
  #   billing currency) and `unit` (the denomination the prices are quoted in,
  #   currently always `1M_tokens` for token-priced models).
  #
  #   @return [Hash{Symbol=>String}, nil]
  optional :pricing, Telnyx::Internal::Type::HashOf[String]

  # @!attribute recommended_for_assistants
  #   Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI
  #   Assistant.
  #
  #   @return [Boolean, nil]
  optional :recommended_for_assistants, Telnyx::Internal::Type::Boolean

  # @!attribute regions
  #   Public region names where the model is currently deployed (e.g. `us-central-1`,
  #   `eu-central-1`).
  #
  #   @return [Array<String>, nil]
  optional :regions, Telnyx::Internal::Type::ArrayOf[String]

  # @!attribute task
  #   Primary task the model is intended for, e.g. `text-generation`,
  #   `audio-text-to-text`, `feature-extraction` (embeddings).
  #
  #   @return [String, nil]
  optional :task, String

  # @!method initialize(id:, context_length:, created:, languages:, license:, organization:, owned_by:, parameters:, tier:, base_model: nil, description: nil, is_fine_tunable: nil, is_vision_supported: nil, max_completion_tokens: nil, object: nil, parameters_str: nil, pricing: nil, recommended_for_assistants: nil, regions: nil, task: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::AIRetrieveModelsResponse::Data} for more details.
  #
  #   Metadata for a model available on Telnyx Inference. Returned by
  #   `GET /v2/ai/openai/models` (and the deprecated `GET /v2/ai/models`). Open-source
  #   models live under their Hugging Face organization (e.g. `moonshotai/Kimi-K2.6`,
  #   `zai-org/GLM-5.1-FP8`, `MiniMaxAI/MiniMax-M2.7`); fine-tuned models are owned by
  #   the Telnyx organization that trained them.
  #
  #   @param id [String] Model identifier. For open-source models, follows the `{organization}/{model_nam
  #
  #   @param context_length [Integer] Maximum total tokens (prompt + completion) supported by the model in a single re
  #
  #   @param created [Time] Timestamp at which the model was registered on Telnyx Inference (ISO 8601).
  #
  #   @param languages [Array<String>] ISO language codes the model supports (e.g. `en`, `es`).
  #
  #   @param license [String] License the model is distributed under, e.g. `Apache 2.0`, `MIT`, `Llama 3 Commu
  #
  #   @param organization [String] Organization that originally published the model, matching the prefix of `id` fo
  #
  #   @param owned_by [String] Owner of the model. `Telnyx` for Telnyx-hosted open-source models, the upstream
  #
  #   @param parameters [Integer] Total parameter count of the model.
  #
  #   @param tier [Symbol, Telnyx::Models::AIRetrieveModelsResponse::Data::Tier] Billing tier the model belongs to. Used together with `pricing` to determine cos
  #
  #   @param base_model [String, nil] Base model the fine-tuned model was trained from. Only set for fine-tuned models
  #
  #   @param description [String, nil] Short, human-readable summary of what the model is best suited for.
  #
  #   @param is_fine_tunable [Boolean] Whether the model can be used as a base for a fine-tuning job via `POST /v2/ai/f
  #
  #   @param is_vision_supported [Boolean] Whether the model accepts image inputs in chat completions (multimodal vision su
  #
  #   @param max_completion_tokens [Integer, nil] Maximum number of completion (output) tokens the model will generate per request
  #
  #   @param object [String] Object type. Always `model`.
  #
  #   @param parameters_str [String, nil] Human-readable parameter count, e.g. `1.0T`, `753.9B`, `8B`.
  #
  #   @param pricing [Hash{Symbol=>String}] Mapping of token kind to price, as strings to preserve precision. Typical keys a
  #
  #   @param recommended_for_assistants [Boolean] Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI A
  #
  #   @param regions [Array<String>] Public region names where the model is currently deployed (e.g. `us-central-1`,
  #
  #   @param task [String] Primary task the model is intended for, e.g. `text-generation`, `audio-text-to-t

  # Billing tier the model belongs to. Used together with `pricing` to determine
  # cost per 1M tokens.
  #
  # @see Telnyx::Models::AIRetrieveModelsResponse::Data#tier
  module Tier
    extend Telnyx::Internal::Type::Enum

    SMALL = :small
    MEDIUM = :medium
    LARGE = :large
    UNLISTED = :unlisted

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#base_modelString?

Base model the fine-tuned model was trained from. Only set for fine-tuned models.

Returns:

  • (String, nil)


89
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 89

optional :base_model, String, nil?: true

#context_lengthInteger

Maximum total tokens (prompt + completion) supported by the model in a single request.

Returns:

  • (Integer)


35
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 35

required :context_length, Integer

#createdTime

Timestamp at which the model was registered on Telnyx Inference (ISO 8601).

Returns:

  • (Time)


41
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 41

required :created, Time

#descriptionString?

Short, human-readable summary of what the model is best suited for.

Returns:

  • (String, nil)


95
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 95

optional :description, String, nil?: true

#idString

Model identifier. For open-source models, follows the ‘#organization/model_name` convention from Hugging Face (e.g. `moonshotai/Kimi-K2.6`).

Returns:

  • (String)


28
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 28

required :id, String

#is_fine_tunableBoolean?

Whether the model can be used as a base for a fine-tuning job via ‘POST /v2/ai/fine_tuning/jobs`.

Returns:

  • (Boolean, nil)


102
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 102

optional :is_fine_tunable, Telnyx::Internal::Type::Boolean

#is_vision_supportedBoolean?

Whether the model accepts image inputs in chat completions (multimodal vision support).

Returns:

  • (Boolean, nil)


109
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 109

optional :is_vision_supported, Telnyx::Internal::Type::Boolean

#languagesArray<String>

ISO language codes the model supports (e.g. ‘en`, `es`).

Returns:

  • (Array<String>)


47
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 47

required :languages, Telnyx::Internal::Type::ArrayOf[String]

#licenseString

License the model is distributed under, e.g. ‘Apache 2.0`, `MIT`, `Llama 3 Community License`.

Returns:

  • (String)


54
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 54

required :license, String

#max_completion_tokensInteger?

Maximum number of completion (output) tokens the model will generate per request. ‘null` if unconstrained beyond `context_length`.

Returns:

  • (Integer, nil)


116
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 116

optional :max_completion_tokens, Integer, nil?: true

#objectString?

Object type. Always ‘model`.

Returns:

  • (String, nil)


122
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 122

optional :object, String

#organizationString

Organization that originally published the model, matching the prefix of ‘id` for open-source models.

Returns:

  • (String)


61
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 61

required :organization, String

#owned_byString

Owner of the model. ‘Telnyx` for Telnyx-hosted open-source models, the upstream provider name for proxied models, or the Telnyx organization id for fine-tuned models.

Returns:

  • (String)


69
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 69

required :owned_by, String

#parametersInteger

Total parameter count of the model.

Returns:

  • (Integer)


75
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 75

required :parameters, Integer

#parameters_strString?

Human-readable parameter count, e.g. ‘1.0T`, `753.9B`, `8B`.

Returns:

  • (String, nil)


128
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 128

optional :parameters_str, String, nil?: true

#pricingHash{Symbol=>String}?

Mapping of token kind to price, as strings to preserve precision. Typical keys are ‘prompt`, `cached_prompt`, and `completion`. When pricing is available the block also includes `currency` (ISO 4217 code matching the account’s configured billing currency) and ‘unit` (the denomination the prices are quoted in, currently always `1M_tokens` for token-priced models).

Returns:

  • (Hash{Symbol=>String}, nil)


138
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 138

optional :pricing, Telnyx::Internal::Type::HashOf[String]

Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI Assistant.

Returns:

  • (Boolean, nil)


145
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 145

optional :recommended_for_assistants, Telnyx::Internal::Type::Boolean

#regionsArray<String>?

Public region names where the model is currently deployed (e.g. ‘us-central-1`, `eu-central-1`).

Returns:

  • (Array<String>, nil)


152
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 152

optional :regions, Telnyx::Internal::Type::ArrayOf[String]

#taskString?

Primary task the model is intended for, e.g. ‘text-generation`, `audio-text-to-text`, `feature-extraction` (embeddings).

Returns:

  • (String, nil)


159
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 159

optional :task, String

#tierSymbol, Telnyx::Models::AIRetrieveModelsResponse::Data::Tier

Billing tier the model belongs to. Used together with ‘pricing` to determine cost per 1M tokens.



82
# File 'lib/telnyx/models/ai_retrieve_models_response.rb', line 82

required :tier, enum: -> { Telnyx::Models::AIRetrieveModelsResponse::Data::Tier }