Skip to content

Commit d4057b0

Browse files
feat(api): Add support for claude-mythos-preview
1 parent 04a67c8 commit d4057b0

File tree

8 files changed

+36
-83
lines changed

8 files changed

+36
-83
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-efe26b096126c693462514b8cbd3ec3e376569232becbfb730cd26fb31c7c7e3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-04225437444990f383d0581df2f07022baab6ad510de0f3a8bd6b07c38d83cc9.yml
33
openapi_spec_hash: cae9199aabfd7b87f0ff2dcc10760c92
4-
config_hash: e1ebf6470ea96e5b7bf02520fbeeed0a
4+
config_hash: fcc34074db6eaf64bc99b578c6c82c61

src/resources/beta/messages/batches.ts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,9 @@ export namespace BatchCreateParams {
634634
system?: string | Array<BetaMessagesAPI.BetaTextBlockParam>;
635635

636636
/**
637-
* Amount of randomness injected into the response.
638-
*
639-
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
640-
* for analytical / multiple choice, and closer to `1.0` for creative and
641-
* generative tasks.
642-
*
643-
* Note that even with `temperature` of `0.0`, the results will not be fully
644-
* deterministic.
637+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
638+
* setting temperature. A value of 1.0 of will be accepted for backwards
639+
* compatibility, all other values will be rejected with a 400 error.
645640
*/
646641
temperature?: number;
647642

@@ -744,26 +739,15 @@ export namespace BatchCreateParams {
744739
tools?: Array<BetaMessagesAPI.BetaToolUnion>;
745740

746741
/**
747-
* Only sample from the top K options for each subsequent token.
748-
*
749-
* Used to remove "long tail" low probability responses.
750-
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
751-
*
752-
* Recommended for advanced use cases only. You usually only need to use
753-
* `temperature`.
742+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept
743+
* top_k; any value will be rejected with a 400 error.
754744
*/
755745
top_k?: number;
756746

757747
/**
758-
* Use nucleus sampling.
759-
*
760-
* In nucleus sampling, we compute the cumulative distribution over all the options
761-
* for each subsequent token in decreasing probability order and cut it off once it
762-
* reaches a particular probability specified by `top_p`. You should either alter
763-
* `temperature` or `top_p`, but not both.
764-
*
765-
* Recommended for advanced use cases only. You usually only need to use
766-
* `temperature`.
748+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
749+
* setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
750+
* other values will be rejected with a 400 error.
767751
*/
768752
top_p?: number;
769753
}

src/resources/beta/messages/messages.ts

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class Messages extends APIResource {
201201
* const betaMessageTokensCount =
202202
* await client.beta.messages.countTokens({
203203
* messages: [{ content: 'string', role: 'user' }],
204-
* model: 'claude-opus-4-6',
204+
* model: 'claude-mythos-preview',
205205
* });
206206
* ```
207207
*/
@@ -3714,14 +3714,9 @@ export interface MessageCreateParamsBase {
37143714
system?: string | Array<BetaTextBlockParam>;
37153715

37163716
/**
3717-
* Body param: Amount of randomness injected into the response.
3718-
*
3719-
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
3720-
* for analytical / multiple choice, and closer to `1.0` for creative and
3721-
* generative tasks.
3722-
*
3723-
* Note that even with `temperature` of `0.0`, the results will not be fully
3724-
* deterministic.
3717+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
3718+
* setting temperature. A value of 1.0 of will be accepted for backwards
3719+
* compatibility, all other values will be rejected with a 400 error.
37253720
*/
37263721
temperature?: number;
37273722

@@ -3824,26 +3819,15 @@ export interface MessageCreateParamsBase {
38243819
tools?: Array<BetaToolUnion>;
38253820

38263821
/**
3827-
* Body param: Only sample from the top K options for each subsequent token.
3828-
*
3829-
* Used to remove "long tail" low probability responses.
3830-
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
3831-
*
3832-
* Recommended for advanced use cases only. You usually only need to use
3833-
* `temperature`.
3822+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept
3823+
* top_k; any value will be rejected with a 400 error.
38343824
*/
38353825
top_k?: number;
38363826

38373827
/**
3838-
* Body param: Use nucleus sampling.
3839-
*
3840-
* In nucleus sampling, we compute the cumulative distribution over all the options
3841-
* for each subsequent token in decreasing probability order and cut it off once it
3842-
* reaches a particular probability specified by `top_p`. You should either alter
3843-
* `temperature` or `top_p`, but not both.
3844-
*
3845-
* Recommended for advanced use cases only. You usually only need to use
3846-
* `temperature`.
3828+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
3829+
* setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
3830+
* other values will be rejected with a 400 error.
38473831
*/
38483832
top_p?: number;
38493833

src/resources/completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class Completions extends APIResource {
2424
* ```ts
2525
* const completion = await client.completions.create({
2626
* max_tokens_to_sample: 256,
27-
* model: 'claude-opus-4-6',
27+
* model: 'claude-mythos-preview',
2828
* prompt: '\n\nHuman: Hello, world!\n\nAssistant:',
2929
* });
3030
* ```

src/resources/messages/messages.ts

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class Messages extends APIResource {
177177
* const messageTokensCount =
178178
* await client.messages.countTokens({
179179
* messages: [{ content: 'string', role: 'user' }],
180-
* model: 'claude-opus-4-6',
180+
* model: 'claude-mythos-preview',
181181
* });
182182
* ```
183183
*/
@@ -1075,6 +1075,7 @@ export interface Metadata {
10751075
* details and options.
10761076
*/
10771077
export type Model =
1078+
| 'claude-mythos-preview'
10781079
| 'claude-opus-4-6'
10791080
| 'claude-sonnet-4-6'
10801081
| 'claude-haiku-4-5'
@@ -2814,14 +2815,9 @@ export interface MessageCreateParamsBase {
28142815
system?: string | Array<TextBlockParam>;
28152816

28162817
/**
2817-
* Amount of randomness injected into the response.
2818-
*
2819-
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
2820-
* for analytical / multiple choice, and closer to `1.0` for creative and
2821-
* generative tasks.
2822-
*
2823-
* Note that even with `temperature` of `0.0`, the results will not be fully
2824-
* deterministic.
2818+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
2819+
* setting temperature. A value of 1.0 of will be accepted for backwards
2820+
* compatibility, all other values will be rejected with a 400 error.
28252821
*/
28262822
temperature?: number;
28272823

@@ -2924,26 +2920,15 @@ export interface MessageCreateParamsBase {
29242920
tools?: Array<ToolUnion>;
29252921

29262922
/**
2927-
* Only sample from the top K options for each subsequent token.
2928-
*
2929-
* Used to remove "long tail" low probability responses.
2930-
* [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
2931-
*
2932-
* Recommended for advanced use cases only. You usually only need to use
2933-
* `temperature`.
2923+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept
2924+
* top_k; any value will be rejected with a 400 error.
29342925
*/
29352926
top_k?: number;
29362927

29372928
/**
2938-
* Use nucleus sampling.
2939-
*
2940-
* In nucleus sampling, we compute the cumulative distribution over all the options
2941-
* for each subsequent token in decreasing probability order and cut it off once it
2942-
* reaches a particular probability specified by `top_p`. You should either alter
2943-
* `temperature` or `top_p`, but not both.
2944-
*
2945-
* Recommended for advanced use cases only. You usually only need to use
2946-
* `temperature`.
2929+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
2930+
* setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
2931+
* other values will be rejected with a 400 error.
29472932
*/
29482933
top_p?: number;
29492934
}

tests/api-resources/beta/messages/messages.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('resource messages', () => {
120120
test('countTokens: only required params', async () => {
121121
const responsePromise = client.beta.messages.countTokens({
122122
messages: [{ content: 'string', role: 'user' }],
123-
model: 'claude-opus-4-6',
123+
model: 'claude-mythos-preview',
124124
});
125125
const rawResponse = await responsePromise.asResponse();
126126
expect(rawResponse).toBeInstanceOf(Response);
@@ -134,7 +134,7 @@ describe('resource messages', () => {
134134
test('countTokens: required and optional params', async () => {
135135
const response = await client.beta.messages.countTokens({
136136
messages: [{ content: 'string', role: 'user' }],
137-
model: 'claude-opus-4-6',
137+
model: 'claude-mythos-preview',
138138
cache_control: { type: 'ephemeral', ttl: '5m' },
139139
context_management: {
140140
edits: [

tests/api-resources/completions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('resource completions', () => {
1111
test('create: only required params', async () => {
1212
const responsePromise = client.completions.create({
1313
max_tokens_to_sample: 256,
14-
model: 'claude-opus-4-6',
14+
model: 'claude-mythos-preview',
1515
prompt: '\n\nHuman: Hello, world!\n\nAssistant:',
1616
});
1717
const rawResponse = await responsePromise.asResponse();
@@ -26,7 +26,7 @@ describe('resource completions', () => {
2626
test('create: required and optional params', async () => {
2727
const response = await client.completions.create({
2828
max_tokens_to_sample: 256,
29-
model: 'claude-opus-4-6',
29+
model: 'claude-mythos-preview',
3030
prompt: '\n\nHuman: Hello, world!\n\nAssistant:',
3131
metadata: { user_id: '13803d75-b4b5-4c3e-b2a2-6f21399b021b' },
3232
stop_sequences: ['string'],

tests/api-resources/messages/messages.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('resource messages', () => {
8888
test('countTokens: only required params', async () => {
8989
const responsePromise = client.messages.countTokens({
9090
messages: [{ content: 'string', role: 'user' }],
91-
model: 'claude-opus-4-6',
91+
model: 'claude-mythos-preview',
9292
});
9393
const rawResponse = await responsePromise.asResponse();
9494
expect(rawResponse).toBeInstanceOf(Response);
@@ -102,7 +102,7 @@ describe('resource messages', () => {
102102
test('countTokens: required and optional params', async () => {
103103
const response = await client.messages.countTokens({
104104
messages: [{ content: 'string', role: 'user' }],
105-
model: 'claude-opus-4-6',
105+
model: 'claude-mythos-preview',
106106
cache_control: { type: 'ephemeral', ttl: '5m' },
107107
output_config: {
108108
effort: 'low',

0 commit comments

Comments
 (0)