Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .spec-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6ace098c56527cf0a0e5018b67ec454412ee6926
00f83c68ebc94fd2bde0c8cb9d8bbc35ed1d6346
2 changes: 1 addition & 1 deletion src/onepin/.fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
]
},
"originGitCommit": "9e634eff3eb65ab32b4a77b6fee5e0d27aa126cf",
"originGitCommit": "8161f2e78f880139a10f4fbd560a506103452095",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"ciProvider": "github"
Expand Down
15 changes: 15 additions & 0 deletions src/onepin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
NumericOption,
PaginationMeta,
PlanLimits,
PlanLimitsCreditsRenewal,
PlanTier,
PortOut,
PronunciationSuggestion,
Expand Down Expand Up @@ -144,6 +145,7 @@
VoiceFacetItem,
VoiceFacetsOut,
VoiceGender,
VoiceModelCapabilityOut,
VoiceOut,
VoiceSimilarOut,
VoiceSource,
Expand Down Expand Up @@ -192,6 +194,9 @@
WorkflowRunOverviewValidatorOut,
WorkflowRunOverviewValidatorOutStatus,
WorkflowRunOverviewWorkflowOut,
WorkflowRunSinkOutputDelivery,
WorkflowRunSinkOutputDeliveryCheck,
WorkflowRunSinkOutputLine,
WorkflowRunSinkOutputOut,
WorkflowRunStartIn,
WorkflowRunStatusOut,
Expand Down Expand Up @@ -368,6 +373,7 @@
"OnepinClient": "._client",
"PaginationMeta": ".types",
"PlanLimits": ".types",
"PlanLimitsCreditsRenewal": ".types",
"PlanTier": ".types",
"PortOut": ".types",
"PronunciationSuggestion": ".types",
Expand Down Expand Up @@ -425,6 +431,7 @@
"VoiceFacetItem": ".types",
"VoiceFacetsOut": ".types",
"VoiceGender": ".types",
"VoiceModelCapabilityOut": ".types",
"VoiceOut": ".types",
"VoiceSimilarOut": ".types",
"VoiceSource": ".types",
Expand Down Expand Up @@ -473,6 +480,9 @@
"WorkflowRunOverviewValidatorOut": ".types",
"WorkflowRunOverviewValidatorOutStatus": ".types",
"WorkflowRunOverviewWorkflowOut": ".types",
"WorkflowRunSinkOutputDelivery": ".types",
"WorkflowRunSinkOutputDeliveryCheck": ".types",
"WorkflowRunSinkOutputLine": ".types",
"WorkflowRunSinkOutputOut": ".types",
"WorkflowRunStartIn": ".types",
"WorkflowRunStatusOut": ".types",
Expand Down Expand Up @@ -639,6 +649,7 @@ def __dir__():
"OnepinClient",
"PaginationMeta",
"PlanLimits",
"PlanLimitsCreditsRenewal",
"PlanTier",
"PortOut",
"PronunciationSuggestion",
Expand Down Expand Up @@ -696,6 +707,7 @@ def __dir__():
"VoiceFacetItem",
"VoiceFacetsOut",
"VoiceGender",
"VoiceModelCapabilityOut",
"VoiceOut",
"VoiceSimilarOut",
"VoiceSource",
Expand Down Expand Up @@ -744,6 +756,9 @@ def __dir__():
"WorkflowRunOverviewValidatorOut",
"WorkflowRunOverviewValidatorOutStatus",
"WorkflowRunOverviewWorkflowOut",
"WorkflowRunSinkOutputDelivery",
"WorkflowRunSinkOutputDeliveryCheck",
"WorkflowRunSinkOutputLine",
"WorkflowRunSinkOutputOut",
"WorkflowRunStartIn",
"WorkflowRunStatusOut",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
import typing

ListDictionaryEntriesApiV1DictionaryGetRequestLanguage = typing.Union[
typing.Literal["de-de", "en-gb", "en-us", "es-es", "fr-fr", "it-it", "ja-jp", "ko-kr", "pt-br", "zh-cn"], typing.Any
typing.Literal["de-de", "en-gb", "en-us", "es-es", "es-mx", "fr-fr", "ja-jp", "ko-kr", "pt-br", "pt-pt", "zh-cn"],
typing.Any,
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
import typing

SearchDictionaryEntriesApiV1DictionarySearchGetRequestLanguageItem = typing.Union[
typing.Literal["de-de", "en-gb", "en-us", "es-es", "fr-fr", "it-it", "ja-jp", "ko-kr", "pt-br", "zh-cn"], typing.Any
typing.Literal["de-de", "en-gb", "en-us", "es-es", "es-mx", "fr-fr", "ja-jp", "ko-kr", "pt-br", "pt-pt", "zh-cn"],
typing.Any,
]
13 changes: 9 additions & 4 deletions src/onepin/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,7 @@ client.voices.list()
<dl>
<dd>

**search:** `typing.Optional[str]` — Full-text search against voice name, description, and tags.
**search:** `typing.Optional[str]` — Searches name, tags, and the voice's summary-derived descriptor text (closely tracks the served description; summary beyond 200 chars is not searched).

</dd>
</dl>
Expand Down Expand Up @@ -5316,9 +5316,14 @@ attempt a workflow run. `remaining` is a display convenience derived from
settled ledger entries and may temporarily exceed `balance` while a workflow
run holds an open reserve. `used` reflects credits consumed in the current
billing period. `plan_grant` is the total monthly credit allowance for the
caller's plan, enabling a "X / Y used" display. `period_start` and
`period_end` mark the boundaries of the current billing window; free-tier
callers use a calendar-month boundary.
caller's plan, enabling a "X / Y used" display. `period_start` is the current
credit anchor and `period_end` is the next EXPECTED credit-reset boundary
(`period_start` + 1 month), or null when no reset is promised — Free/one-time,
unanchored, a canceling/ended entitlement, or a monthly renewal whose boundary
passed without confirmed payment. `period_end` is the expected boundary, not a
guaranteed grant time: monthly credits stay gated on successful Stripe payment.
For an annual subscriber this GET may perform idempotent maintenance, granting
any due intermediate monthly credits before returning; retries remain safe.
</dd>
</dl>
</dd>
Expand Down
15 changes: 15 additions & 0 deletions src/onepin/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
from .numeric_option import NumericOption
from .pagination_meta import PaginationMeta
from .plan_limits import PlanLimits
from .plan_limits_credits_renewal import PlanLimitsCreditsRenewal
from .plan_tier import PlanTier
from .port_out import PortOut
from .pronunciation_suggestion import PronunciationSuggestion
Expand Down Expand Up @@ -145,6 +146,7 @@
from .voice_facet_item import VoiceFacetItem
from .voice_facets_out import VoiceFacetsOut
from .voice_gender import VoiceGender
from .voice_model_capability_out import VoiceModelCapabilityOut
from .voice_out import VoiceOut
from .voice_similar_out import VoiceSimilarOut
from .voice_source import VoiceSource
Expand Down Expand Up @@ -193,6 +195,9 @@
from .workflow_run_overview_validator_out import WorkflowRunOverviewValidatorOut
from .workflow_run_overview_validator_out_status import WorkflowRunOverviewValidatorOutStatus
from .workflow_run_overview_workflow_out import WorkflowRunOverviewWorkflowOut
from .workflow_run_sink_output_delivery import WorkflowRunSinkOutputDelivery
from .workflow_run_sink_output_delivery_check import WorkflowRunSinkOutputDeliveryCheck
from .workflow_run_sink_output_line import WorkflowRunSinkOutputLine
from .workflow_run_sink_output_out import WorkflowRunSinkOutputOut
from .workflow_run_start_in import WorkflowRunStartIn
from .workflow_run_status_out import WorkflowRunStatusOut
Expand Down Expand Up @@ -295,6 +300,7 @@
"NumericOption": ".numeric_option",
"PaginationMeta": ".pagination_meta",
"PlanLimits": ".plan_limits",
"PlanLimitsCreditsRenewal": ".plan_limits_credits_renewal",
"PlanTier": ".plan_tier",
"PortOut": ".port_out",
"PronunciationSuggestion": ".pronunciation_suggestion",
Expand Down Expand Up @@ -341,6 +347,7 @@
"VoiceFacetItem": ".voice_facet_item",
"VoiceFacetsOut": ".voice_facets_out",
"VoiceGender": ".voice_gender",
"VoiceModelCapabilityOut": ".voice_model_capability_out",
"VoiceOut": ".voice_out",
"VoiceSimilarOut": ".voice_similar_out",
"VoiceSource": ".voice_source",
Expand Down Expand Up @@ -389,6 +396,9 @@
"WorkflowRunOverviewValidatorOut": ".workflow_run_overview_validator_out",
"WorkflowRunOverviewValidatorOutStatus": ".workflow_run_overview_validator_out_status",
"WorkflowRunOverviewWorkflowOut": ".workflow_run_overview_workflow_out",
"WorkflowRunSinkOutputDelivery": ".workflow_run_sink_output_delivery",
"WorkflowRunSinkOutputDeliveryCheck": ".workflow_run_sink_output_delivery_check",
"WorkflowRunSinkOutputLine": ".workflow_run_sink_output_line",
"WorkflowRunSinkOutputOut": ".workflow_run_sink_output_out",
"WorkflowRunStartIn": ".workflow_run_start_in",
"WorkflowRunStatusOut": ".workflow_run_status_out",
Expand Down Expand Up @@ -515,6 +525,7 @@ def __dir__():
"NumericOption",
"PaginationMeta",
"PlanLimits",
"PlanLimitsCreditsRenewal",
"PlanTier",
"PortOut",
"PronunciationSuggestion",
Expand Down Expand Up @@ -561,6 +572,7 @@ def __dir__():
"VoiceFacetItem",
"VoiceFacetsOut",
"VoiceGender",
"VoiceModelCapabilityOut",
"VoiceOut",
"VoiceSimilarOut",
"VoiceSource",
Expand Down Expand Up @@ -609,6 +621,9 @@ def __dir__():
"WorkflowRunOverviewValidatorOut",
"WorkflowRunOverviewValidatorOutStatus",
"WorkflowRunOverviewWorkflowOut",
"WorkflowRunSinkOutputDelivery",
"WorkflowRunSinkOutputDeliveryCheck",
"WorkflowRunSinkOutputLine",
"WorkflowRunSinkOutputOut",
"WorkflowRunStartIn",
"WorkflowRunStatusOut",
Expand Down
2 changes: 2 additions & 0 deletions src/onepin/types/api_error_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
class ApiErrorDetail(UniversalBaseModel):
field: str
message: str
line_numbers: typing.Optional[typing.List[int]] = None
min_chars: typing.Optional[int] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
43 changes: 40 additions & 3 deletions src/onepin/types/balance_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,26 @@ class BalanceResponse(UniversalBaseModel):
Per-user credit balance + period anchor (consumed by GET /users/me/credits).
"""

balance: int
balance: int = pydantic.Field()
"""
Total spendable credits = monthly_balance + free_balance.
"""

monthly_balance: typing.Optional[int] = pydantic.Field(default=None)
"""
Expiring bucket: the current paid cycle's allowance, replaced each renewal. 0 on Free.
"""

free_balance: typing.Optional[int] = pydantic.Field(default=None)
"""
Lifetime bucket: the one-time Free grant. Never expires; spent last (after monthly).
"""

free_grant: typing.Optional[int] = pydantic.Field(default=None)
"""
All-time ceiling of the lifetime free bucket.
"""

used: typing.Optional[int] = pydantic.Field(default=None)
"""
Ledger-derived credits used in the current billing period.
Expand All @@ -24,10 +43,28 @@ class BalanceResponse(UniversalBaseModel):
Ledger-derived settled credits remaining for display only. Excludes in-flight open reserves, so this may exceed `balance` while a workflow is executing. Use `balance` for gate decisions.
"""

period_start: typing.Optional[dt.datetime] = None
period_end: typing.Optional[dt.datetime] = None
period_start: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
Start of the current credit period (the stored credit anchor). Null on Free/unanchored accounts.
"""

period_end: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
Next EXPECTED credit-reset boundary (`period_start` + 1 calendar month), or null when no reset is currently promised: Free/one-time or unanchored accounts, a canceling/ended entitlement with no future grant, or a monthly renewal whose boundary has already passed without confirmed payment. This is the expected boundary, not a guaranteed grant time — monthly credits (including an annual subscription's renewal) stay gated on successful Stripe payment and may become available shortly after this time. An annual subscription's intermediate monthly boundaries are deterministic and are granted on access. Distinct from `CustomerSubscriptionResponse.current_period_end`, which remains the Stripe billing/entitlement boundary and must not be used as the credit-refresh time.
"""

plan_grant: int
plan_tier: PlanTier
overage_rate_cents_per_credit: typing.Optional[float] = None
overage_cents: typing.Optional[int] = pydantic.Field(default=None)
"""
Overage billed so far this billing cycle, in cents.
"""

credits_absorbed: typing.Optional[float] = pydantic.Field(default=None)
"""
Total credits discounted by floor-rounding this billing period.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
3 changes: 3 additions & 0 deletions src/onepin/types/estimate_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class EstimateResponse(UniversalBaseModel):
current_balance: int
deficit_at_max: int
can_run: bool
overage_rate_cents_per_credit: typing.Optional[float] = None
will_incur_overage: typing.Optional[bool] = None
estimated_overage_cents: typing.Optional[int] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
4 changes: 4 additions & 0 deletions src/onepin/types/plan_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .plan_limits_credits_renewal import PlanLimitsCreditsRenewal


class PlanLimits(UniversalBaseModel):
Expand All @@ -18,6 +19,9 @@ class PlanLimits(UniversalBaseModel):
retention_days: typing.Optional[int] = None
byok_enabled: typing.Optional[bool] = None
auto_fix_enabled: typing.Optional[bool] = None
credits_renewal: typing.Optional[PlanLimitsCreditsRenewal] = None
downloads_enabled: typing.Optional[bool] = None
overage_rate_cents_per_credit: typing.Optional[float] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
5 changes: 5 additions & 0 deletions src/onepin/types/plan_limits_credits_renewal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

PlanLimitsCreditsRenewal = typing.Union[typing.Literal["monthly", "one_time"], typing.Any]
29 changes: 29 additions & 0 deletions src/onepin/types/voice_model_capability_out.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class VoiceModelCapabilityOut(UniversalBaseModel):
model: str = pydantic.Field()
"""
Model identifier for this exact voice capability.
"""

languages_known: bool = pydantic.Field()
"""
Whether the provider authoritatively supplied locale metadata. False means unknown; true with an empty supported_languages array means known-empty.
"""

supported_languages: typing.Optional[typing.List[str]] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
13 changes: 7 additions & 6 deletions src/onepin/types/voice_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .voice_age import VoiceAge
from .voice_category import VoiceCategory
from .voice_gender import VoiceGender
from .voice_model_capability_out import VoiceModelCapabilityOut
from .voice_source import VoiceSource


Expand Down Expand Up @@ -73,11 +74,6 @@ class VoiceOut(UniversalBaseModel):
Freeform keyword tags for filtering and search.
"""

descriptor: typing.Optional[str] = pydantic.Field(default=None)
"""
Short one-line voice personality descriptor.
"""

uses_count: typing.Optional[int] = pydantic.Field(default=None)
"""
Number of times this voice has been used in workflow runs across the platform.
Expand Down Expand Up @@ -110,7 +106,12 @@ class VoiceOut(UniversalBaseModel):

supported_models: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
Model identifiers this voice is compatible with. Null means compatible with all available models for the provider.
Deprecated compatibility union of model identifiers this voice is compatible with. Null means compatible with all available models for the provider.
"""

model_capabilities: typing.Optional[typing.List[VoiceModelCapabilityOut]] = pydantic.Field(default=None)
"""
Authoritative model-to-language observations after a successful full provider sync. Empty means no authoritative pair observation is available yet.
"""

is_favorite: typing.Optional[bool] = pydantic.Field(default=None)
Expand Down
Loading