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
5b349feb6ae5f31abbc181e369f6ea2d90d15b6e
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
24 changes: 24 additions & 0 deletions src/onepin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
ApiResponseUsageSummaryOut,
ApiResponseVoiceFacetsOut,
ApiResponseVoiceOut,
ApiResponseVoicePreviewOut,
ApiResponseWorkflowNameAvailabilityOut,
ApiResponseWorkflowOut,
ApiResponseWorkflowRunDetailOut,
Expand Down Expand Up @@ -98,6 +99,7 @@
NumericOption,
PaginationMeta,
PlanLimits,
PlanLimitsCreditsRenewal,
PlanTier,
PortOut,
PronunciationSuggestion,
Expand Down Expand Up @@ -144,7 +146,9 @@
VoiceFacetItem,
VoiceFacetsOut,
VoiceGender,
VoiceModelCapabilityOut,
VoiceOut,
VoicePreviewOut,
VoiceSimilarOut,
VoiceSource,
WorkflowDefinitionInput,
Expand Down Expand Up @@ -192,6 +196,9 @@
WorkflowRunOverviewValidatorOut,
WorkflowRunOverviewValidatorOutStatus,
WorkflowRunOverviewWorkflowOut,
WorkflowRunSinkOutputDelivery,
WorkflowRunSinkOutputDeliveryCheck,
WorkflowRunSinkOutputLine,
WorkflowRunSinkOutputOut,
WorkflowRunStartIn,
WorkflowRunStatusOut,
Expand Down Expand Up @@ -249,6 +256,7 @@
ListVoicesRequestOrderItem,
ListVoicesRequestSortItem,
ListVoicesRequestSourceItem,
PreviewVoicesRequestLanguage,
)
from .workflows import ListWorkflowsRequestOrderItem, ListWorkflowsRequestSortItem
_dynamic_imports: typing.Dict[str, str] = {
Expand Down Expand Up @@ -294,6 +302,7 @@
"ApiResponseUsageSummaryOut": ".types",
"ApiResponseVoiceFacetsOut": ".types",
"ApiResponseVoiceOut": ".types",
"ApiResponseVoicePreviewOut": ".types",
"ApiResponseWorkflowNameAvailabilityOut": ".types",
"ApiResponseWorkflowOut": ".types",
"ApiResponseWorkflowRunDetailOut": ".types",
Expand Down Expand Up @@ -368,8 +377,10 @@
"OnepinClient": "._client",
"PaginationMeta": ".types",
"PlanLimits": ".types",
"PlanLimitsCreditsRenewal": ".types",
"PlanTier": ".types",
"PortOut": ".types",
"PreviewVoicesRequestLanguage": ".voices",
"PronunciationSuggestion": ".types",
"ProviderGroupOut": ".types",
"RunStatusCounts": ".types",
Expand Down Expand Up @@ -425,7 +436,9 @@
"VoiceFacetItem": ".types",
"VoiceFacetsOut": ".types",
"VoiceGender": ".types",
"VoiceModelCapabilityOut": ".types",
"VoiceOut": ".types",
"VoicePreviewOut": ".types",
"VoiceSimilarOut": ".types",
"VoiceSource": ".types",
"WorkflowDefinitionInput": ".types",
Expand Down Expand Up @@ -473,6 +486,9 @@
"WorkflowRunOverviewValidatorOut": ".types",
"WorkflowRunOverviewValidatorOutStatus": ".types",
"WorkflowRunOverviewWorkflowOut": ".types",
"WorkflowRunSinkOutputDelivery": ".types",
"WorkflowRunSinkOutputDeliveryCheck": ".types",
"WorkflowRunSinkOutputLine": ".types",
"WorkflowRunSinkOutputOut": ".types",
"WorkflowRunStartIn": ".types",
"WorkflowRunStatusOut": ".types",
Expand Down Expand Up @@ -565,6 +581,7 @@ def __dir__():
"ApiResponseUsageSummaryOut",
"ApiResponseVoiceFacetsOut",
"ApiResponseVoiceOut",
"ApiResponseVoicePreviewOut",
"ApiResponseWorkflowNameAvailabilityOut",
"ApiResponseWorkflowOut",
"ApiResponseWorkflowRunDetailOut",
Expand Down Expand Up @@ -639,8 +656,10 @@ def __dir__():
"OnepinClient",
"PaginationMeta",
"PlanLimits",
"PlanLimitsCreditsRenewal",
"PlanTier",
"PortOut",
"PreviewVoicesRequestLanguage",
"PronunciationSuggestion",
"ProviderGroupOut",
"RunStatusCounts",
Expand Down Expand Up @@ -696,7 +715,9 @@ def __dir__():
"VoiceFacetItem",
"VoiceFacetsOut",
"VoiceGender",
"VoiceModelCapabilityOut",
"VoiceOut",
"VoicePreviewOut",
"VoiceSimilarOut",
"VoiceSource",
"WorkflowDefinitionInput",
Expand Down Expand Up @@ -744,6 +765,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,
]
129 changes: 125 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 @@ -3123,6 +3123,122 @@ client.voices.similar(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.voices.<a href="src/onepin/voices/client.py">preview</a>(...) -> ApiResponseVoicePreviewOut</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Fetch ready-to-play preview audio for one voice in one language.

Returns the preview's `locale`, the `model` it was synthesized with, its
stored `content_type`, and a `sample_url` — a time-limited presigned URL
valid for 1 hour; regenerate it by calling this endpoint again rather than
caching it long-term. Pass `model` to prefer a specific TTS model; a
preview from another model is still returned when that model has none.

`language` accepts a bare family (`ko`, `en`) as well as an exact locale
(`ko-kr`, `en-gb`). A bare family expands to every supported locale in it,
and which region wins is deterministic but arbitrary — so the response
echoes the `locale` actually served. Read `locale`, never the request
parameter, when labelling what the caller is hearing.

404 means no preview audio has been generated for this voice in that
locale — NOT that the voice cannot speak it. `supported_languages` on the
voice is the claim about what it can speak; `preview_locales` is the list
of locales this endpoint will succeed for. 404 is also returned when the
voice does not exist or is not accessible to the caller's workspace.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from onepin import OnePinClient
from onepin.environment import OnePinClientEnvironment

client = OnePinClient(
token="<token>",
environment=OnePinClientEnvironment.PROD,
)

client.voices.preview(
voice_id="voice_id",
language="de",
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**voice_id:** `str`

</dd>
</dl>

<dl>
<dd>

**language:** `PreviewVoicesRequestLanguage` — BCP-47 language code, e.g. en-us, ko-kr

</dd>
</dl>

<dl>
<dd>

**model:** `typing.Optional[str]` — TTS model id, e.g. sonic-2

</dd>
</dl>

<dl>
<dd>

**workspace_id:** `typing.Optional[str]`

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -5316,9 +5432,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
Loading